summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2016-07-13ConfigDrive: write 'injected' files and legacy networkingScott Moser
Previous commit disabled the consumption of 'injected' files in configdrive (openstack server boot --file=/target/file=local-file) unless the datasource was in 'pass' mode. The default mode is 'net' so that would never happen. Also here are: a.) a fix for 'links_path_prefix' string from debian, to finally disable the rendering of systemd.link files (LP: #1594546) b.) some comments to apply_network_config c.) implement a backwards compatibility for for distros that do not yet implement apply_network_config by converting the network config into ENI format and calling apply_network. This is required because prior to the previous commit, those distros would have had 'apply_network' called with the openstack provided ENI file. But after this change they will have apply_network_config called by cloudinit's main. d.) a network_state_to_eni helper for converting net config to eni it supports the not-actually-correct 'hwaddress' field in ENI. LP: #1602373
2016-06-22user_data: fix error when user-data is not utf-8 decodableScott Moser
when user-data was not decodable, cloud-init would raise exception. This also changes the signature of user_data.convert_string. The 'headers' argument was never used, and woudl have been broken if it was, as it was expected to be a dictionary but then was passed in with *headers. LP: #1532072
2016-06-22rename test class, add a test, improve test namesScott Moser
2016-06-21user_data: fix error when user-data is not utf-8 decodableScott Moser
when user-data was not decodable, cloud-init would raise exception. LP: #1532072
2016-06-21write_files: if no permissions are given, just use default without warn.Scott Moser
if no permissions were given in a write_files stanza, then a warning would be emitted. The fix here is just to special case handling of None.
2016-06-20do not render systemd.link filesScott Moser
When fixing bug 1579130, we made cloud-init rename devices itself, rather than relying on the systemd.link files to do that. That was necessary to - rename devices in a container - rename devices on first boot or in any situation when the link files in the initramfs were stale. However, cloud-init was still writing .link files like: /etc/systemd/network/50-cloud-init-ens2.link That leads to just a confusing situation as cloud-init will trump any renaming systemd does in all cases. Also added here is a header into the rendered ENI file: /etc/network/interfaces.d/50-cloud-init.cfg that describes how to disable cloud-init networking. LP: #1594546
2016-06-20add a header to rendered ENI file describing its contentScott Moser
2016-06-20do not render systemd.link files on debian.Scott Moser
These are unnecessary, as cloud-init is renaming the nics that should be renamed itself.
2016-06-20leave early if no interfaces to renameScott Moser
2016-06-15support network rendering to sysconfig (for centos and RHEL)Scott Moser
This intends to add support for rendering of network data under sysconfig distributions (centos and rhel). The end result will be support for network configuration via ConfigDrive or NoCloud on these OS.
2016-06-15python3 OSError does not have a .messageScott Moser
2016-06-15merge with trunkScott Moser
2016-06-15DataSourceNoCloud: fix stack trace on reboot, default to dsmode=netScott Moser
On reboot (loading module from obj.pkl) we would hit a AttributeError when trying to access cmdline_id. Addtionally, dsmode was inadvertantly defaulting to local for DataSourceNoCloud. LP: #1592505
2016-06-15remove declaration of dsmode as local in DataSourceNoCloudScott Moser
this would cause the datasource to operate in local mode by default.
2016-06-15fix usage of OSError.message that will not work in python3Scott Moser
python3's OSError does not have a .message attribute.
2016-06-15merge from trunkScott Moser
2016-06-15fix some errors reported by pylintScott Moser
pylint --errors-only found several errors. Some of the changes here represent real errors, others just code that pylint did not like.
2016-06-15merge with trunkScott Moser
2016-06-15move 'main' into cloudinit/cmd/ for easier testingScott Moser
This moves bin/cloud-init's content into cloudinit/cmd/main.py, and then fixes the pep8/flake8 issues with that. The end result is easier testing of main.
2016-06-15merge with trunkScott Moser
2016-06-15fis some Datasourcenocloud issuesScott Moser
LP: #1592505
2016-06-15Fix line length issuesJoshua Harlow
2016-06-15Fixup code review commentsJoshua Harlow
2016-06-15move 'main' into cloudinit/cmd/ for easier testingScott Moser
This moves bin/cloud-init's content into cloudinit/cmd/main.py, and then fixes the pep8/flake8 issues with that. The end result is easier testing of main.
2016-06-15Remove some unused importsJoshua Harlow
2016-06-15Remove /bin from run-pyflakesJoshua Harlow
2016-06-15Fix a few tools and tests for newer pep8Joshua Harlow
2016-06-15Silence pep8 warnings due to patcher activationJoshua Harlow
2016-06-15Re-apply "Remove trailing dot from GCE metadata URL (LP: #1581200) [Phil Roche]"Daniel Watkins
This commit includes the content of that commit, plus a fix for the tests (provided by Phil).
2016-06-14Don't continue running with no actionJoshua Harlow
2016-06-14Retain the prior attribute missing handlingJoshua Harlow
2016-06-14Make the bin/cloud-init an actual console entrypointJoshua Harlow
This allows for the test_cli test to be more sane.
2016-06-14fix pep8 failure introduced in recent commit.Scott Moser
The commit 1232 (Refactor a large part of the networking code) broke pep8.
2016-06-14[Revert] Remove trailing dot from GCE metadata URLScott Moser
This change broke tox tests.
2016-06-14Make the os samples easier to extend (for new samples)Joshua Harlow
2016-06-13Refactor some of sysconfig changes -> network_state moduleJoshua Harlow
2016-06-13Remove trailing dot from GCE metadata URL (LP: #1581200) [Phil Roche]Daniel Watkins
LP: #1581200
2016-06-13Removes trailing dot in metadata.google.internal GCE metadata lookup.Phil Roche
A bug was reported (lp:1581200) where if there is no DNS server configured or it is not running then the metadata lookup on GCE will fail as it contains a trailing dot 'metadata.google.internal.'. As there is no DNS configured or running it will use the /etc/hosts file but the hosts file does not contain an entry with the trailing dot. One solution is to add an entry to the /etc/hosts file with the trailing dot but according to the manpage, /etc/hosts entries must end with an alphanumeric character and cannot end with a dot. The trailing dot was added to avoid MIM by dns search but we should probably assume the instance being started has no DNS and as such when querying metadata should use a URL that will resolve using /etc/hosts. LP: #1581200
2016-06-10Add a bunch more sample tests for sysconfigJoshua Harlow
2016-06-10Add a sysconfig rendering testJoshua Harlow
2016-06-10Fix the broken import and 'parse_net_config_data' function usageJoshua Harlow
2016-06-10Ensure renderer is used in rhelJoshua Harlow
2016-06-10Add a sysconfig rendererJoshua Harlow
2016-06-10Refactor a large part of the networking code.Joshua Harlow
Splits off distro specific code into specific files so that other kinds of networking configuration can be written by the various distro(s) that cloud-init supports. It also isolates some of the cloudinit.net code so that it can be more easily used on its own (and incorporated into other projects such as curtin). During this process it adds tests so that the net process can be tested (to some level) so that the format conversion processes can be tested going forward.
2016-06-10Just mock 'on_first_boot' vs special argumentJoshua Harlow
2016-06-10Just do all the imports on one lineJoshua Harlow
2016-06-10Add unittest2 to builder listJoshua Harlow
2016-06-10clean up temp files made in testsScott Moser
After a 'tox' run, now there are no tmpdirs left in /tmp.
2016-06-10remove unused importScott Moser
2016-06-10one moreScott Moser