unittests: add tests for format conversions with collisions
This covers cases where old and new apt config is specified at the same
time (LP: #1616831)
Cases are:
- good (euqal) convert
- noop convert
- conflicting convert
- good (euqal) dict convert
- noop dict convert
- conflicting dict convert
- missing entry in dict convert
Signed-off-by: Christian Ehrhardt <email address hidden>
Extend test_convert_to_new_format to cover the full conversion chain
V1->V2->V3. Also enhance it to ensure it doesn't fail on an case where
there is no old apt spec.
Signed-off-by: Christian Ehrhardt <email address hidden>
apt-config: prefer v3 config if v1/2 and v3 are specified
Prefer v3 config if v1/2 and v3 are specified (LP: #1616831).
As discussed on top it tried (for all simple mappings) to ensure that
the ignored and the new value are equal and raises a ValueError if not.
This covers all but the mirror spec which changed to much for an easy
comparison.
Signed-off-by: Christian Ehrhardt <email address hidden>
This simplifies the code that calls the actual conversion later on and
at the same time is the base for the latter adding of preferring V3
config with some extra sanity checks.
Signed-off-by: Christian Ehrhardt <email address hidden>
Spacewalk is used by some peopel to manage connections into redhat package
management systems and kickstart and various other tasks, so having a
system be able to do the needed tasks on first boot to integrate with that
system would be very useful (to some).
Adds an install option for for OpenRC init scripts.
I've also restricted installing tests more correctly.
Also, don't hardcode the path to ip (/bin/ip on gentoo).
The OpenStack network_data.json does not provide a name for bond links.
This change makes it so a dummy one is generated and used instead
to satisfy cloud-init which does require one.
In order to write the correct link (underlying 'link' names)
for the bonds, we maintain a list of info by ids so we can easily
get the right device name.
Also:
* add a vlan test case that similarly references an id rather than name.
* make bond interfaces auto
network: fix get_interface_mac for bond slave, read_sys_net for ENOTDIR
When using get_interface_mac, on a system with bond slaves, it would
return the bond_master's address. That isn't expected, and causes
problems in a caller like get_interfaces_by_mac which would then seem to
find duplicate macs on the system.
Additionally, in read_sys_net catch a errno.ENOTDIR error as ENOENT.
Opening a path as a file that has <existing_file>/anything will will raise
ENOTDIR rather than ENOENT. This handles that case in read_sys_net as a
if the file did not exist.
This adds some function to the generator to maintain the presense of a
flag file '/run/cloud-init/enabled' indicating that cloud-init is enabled.
Then, only run the dhclient hooks if on Azure and cloud-init is enabled.
The test for is_azure currently only checks to see that the board vendor
is Microsoft, not actually that we are on azure. Running should not be
harmful anywhere, other than slowing down dhclient.
The value of this additional code is that then dhclient having run
does not task the system with the load of cloud-init.
Additionally, some changes to config are done here.
* rename 'dhclient_leases' to 'dhclient_lease_file'
* move that to the datasource config (datasource/Azure/dhclient_lease_file)
Also, it removes the config in config/cloud.cfg that set agent_command
to __builtin__. This means that by default cloud-init still needs
the agent installed. The suggested follow-on improvement is to
use __builtin__ if there is no walinux-agent installed.