Last commit made on 2017-07-31
Get this branch:
git clone -b sysconfig-resolvconf-duplicate-header-lp1701420 https://git.launchpad.net/~raharper/cloud-init
Only Ryan Harper can upload to this branch. If you are Ryan Harper please log in for upload directions.

Branch merges

Branch information


Recent commits

491585a... by Ryan Harper

sysconfig: Dont repeat header when rendering resolv.conf

The sysconfig renderer duplicates the cloud-init header string
when rendering resolv.conf file. This leads to resolv.conf file
growing with every reboot of a system. Fix this by checking for
the header when loading content from existing file.

Update one of the sysconfig unittests with multiple render calls
to simulate the reboot to check that we don't repeat the header.

LP: #1701420

e586fe3... by Chad Smith

cloudinit.net: add initialize_network_device function and tests

This is not yet called, but will be called in a subsequent Ec2-related branch to manually initialize a network interface with the responses using dhcp discovery without any dhcp-script side-effects. The functionality has been tested on Ec2 ubuntu and CentOS vms to ensure that network interface initialization works in both OS-types.

Since there was poor unit test coverage for the cloudinit.net.__init__ module, this branch adds a bunch of coverage to the functions in cloudinit.net.__init. We can also now have unit tests local to the cloudinit modules. The benefits of having unittests under cloudinit module:
 - Proximity of unittest to cloudinit module makes it easier for ongoing devs to know where to augment unit tests. The tests.unittest directory is organizated such that it
 - Allows for 1 to 1 name mapping module -> tests/test_module.py
 - Improved test and module isolation, if we find unit tests have to import from a number of modules besides the module under test, it will better prompt resturcturing of the module.

This also branch touches:
 - tox.ini to run unit tests found in cloudinit as well as include all test-requirements for pylint since we now have unit tests living within cloudinit package
 - setup.py to exclude any test modules under cloudinit when packaging

664a220... by Chad Smith

makefile: fix ci-deps-ubuntu target

Remove errant hyphen in read-dependencies --distro ubuntu parameter for ci-deps-ubuntu.
All system packages can now be installed for ubuntu with make ci-deps-ubuntu".
[author: powersj, review:blackboxsw]

80bf98b... by Scott Moser

tests: adjust locale integration test to parse default locale.

The locale integration test started failing with commit 0ef61b28.
This was just because the test's expectations on the content/formatting
of /etc/default/locale were too strict. The change here is to read
the file as a set of shell variables and assert that the values are
set correctly.

a31eaa3... by Scott Moser

tests: remove 'yakkety' from releases as it is EOL.

This is not strictly necessary, but since yakkety is no longer supported
we will remove it from the releases.yaml file.

8a5296c... by Scott Moser

centos: do not package systemd-fsck drop-in.

The change here fixes the build of CentOS 7 rpm.

The systemd 'drop-in' file systemd-fsck@.service.d/cloud-init.conf is
not expected to work on CentOS at the moment. There, the
cloud-init-local.service currently runs without DefaultDependencies=no.
That would likely cause a dependency loop.

The drop-in was added for bug 1691489. It may well be needed at a later
date in CentOS also.

1f5489c... by Scott Moser

systemd: make systemd-fsck run after cloud-init.service

cloud-init.service may write filesystems (fs_setup) or re-partition
(disk_setup) disks.

If systemd-fsck is running on a device while that is occuring
then the partitioning or mkfs might fail due to the device being busy.
Alternatively, the fsck might fail and cause subsequent mount to fail.

LP: #1691489

ebdbf30... by Scott Moser

tests: Add initial tests for EC2 and improve a docstring.

EC2 was the original, but this adds some initial tests for that datasource.
Also updates a docstring for an internal method.

0ef61b2... by Scott Moser

locale: Do not re-run locale-gen if provided locale is system default.

If the system configure default in /etc/default/locale is set to the same
value that is provided for cloud-init's "locale" setting, then do not
re-run locale-gen. This allows images built with a locale already
generated to not re-run locale-gen (which can be very heavy).

Also here is a fix to invoke update-locale correctly and remove the
internal writing of /etc/default/locale. We were calling
  update-locale <locale>
This ends up having no affect. The more correct invocation is:
  update-locale LANG=<locale>

Also added some support here should we ever want to change setting
LANG to setting LC_ALL (or any other key).

Lastly, a test change to allow us to use assert_not_called from mock.
Versions of mock in CentOS 6 do not have assert_not_called.

85c984c... by Joshua Powers

archlinux: fix set hostname usage of write_file.

cloud-init fails to set the hostname on Arch Linux because that
_write_hostname passes conf instead of str(conf) to util.write_file.

LP: #1705306