~paelzer/cloud-init:fix-bug-1616831-new-and-old-apt-config

Last commit made on 2016-08-26
Get this branch:
git clone -b fix-bug-1616831-new-and-old-apt-config https://git.launchpad.net/~paelzer/cloud-init
Only Christian Ehrhardt  can upload to this branch. If you are Christian Ehrhardt  please log in for upload directions.

Branch merges

Branch information

Name:
fix-bug-1616831-new-and-old-apt-config
Repository:
lp:~paelzer/cloud-init

Recent commits

2920384... by Christian Ehrhardt 

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>

92e782e... by Christian Ehrhardt 

unittests: extend test_convert_to_new_format

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>

a8a0587... by Christian Ehrhardt 

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>

2bd1d7a... by Christian Ehrhardt 

apt-config: base old / new key mapping on a dict

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>

817df42... by Joshua Harlow

python2.6: fix dict comprehension usage in _lsb_release.

This syntax doesn't work in python 2.6

6fce6db... by Joshua Harlow

Add a module that can configure spacewalk.

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).

See: https://fedorahosted.org/spacewalk/

3f1373a... by Matthew Thode

add install option for openrc

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).

6a8aa46... by Scott Moser

Generate a dummy bond name for OpenStack

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

LP: #1605749

40a2f62... by Scott Moser

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.

64522ef... by Scott Moser

azure dhclient-hook cleanups

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.