summaryrefslogtreecommitdiff
path: root/cloudinit/sources
AgeCommit message (Collapse)Author
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-15merge with trunkScott Moser
2016-06-15fis some Datasourcenocloud issuesScott Moser
LP: #1592505
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-14[Revert] Remove trailing dot from GCE metadata URLScott Moser
This change broke tox tests.
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-10Just mock 'on_first_boot' vs special argumentJoshua Harlow
2016-06-06Rebase against masterJoshua Harlow
2016-06-03config drive conversion: recognize 'bridge' as a physical type, fix mtuScott Moser
the network json in openstack provides a type of 'bridge' when the underlying (host) type is a bridge. Silly, but we need to consider that a physical device as it will be for us. also, the 'mtu' will appear on the link, not on the route
2016-06-02ConfigDrive: do not use 'id' on a link for the device nameScott Moser
'id' on a link in the openstack spec should be "Generic, generated ID". current implementation was to use the host's name for the host side nic. Which provided names like 'tap-adfasdffd'. We do not want to name devices like that as its quite unexpected and non user friendly. So here we use the system name for any nic that is present, but then require that the nics found also be present at the time of rendering. The end result is that if the system boots with net.ifnames=0 then it will get 'eth0' like names. and if it boots without net.ifnames then it will get enp0s1 like names.
2016-06-02re-add the 'Net' classes for datasourcesScott Moser
When the .pkl file is loaded, the module that it is loaded from must have the same symbol. Ie, if booted once and got DataSourceConfigDriveNet then upgraded and rebooted, then next boot would show Can't get attribute 'DataSourceConfigDriveNet'
2016-06-02fix untested previous change to smartosScott Moser
2016-06-02smartos: do not raise error when not on smartosScott Moser
if get_smartos_environ() returned a None, then the datasoure would raise a ValueError when get_data was called. Fix that.
2016-06-02openstack: support decoding when reading files, use that for network_configScott Moser
The network config file is /etc/network/interfaces formated. We will decode that here so that the user can expect that it is a string. The issue was that it was bytes but convert_eni_data was expecting a string.
2016-06-02SmartOS: datasource improvements, support for networking information.Scott Moser
This adds support for reading networking information from the SmartOS metadata service and applying.
2016-05-31use constants for kvm and lx-brandScott Moser
2016-05-27return dict not None on get_config_objScott Moser
2016-05-27smartos is local, but it is named DataSourceSmartOS not DataSourceConfigDriveScott Moser
2016-05-27Smartos datasource is local.Scott Moser
2016-05-27add nicer mainScott Moser
2016-05-27remove debug printScott Moser
2016-05-27fix pyflakes and flake8Scott Moser
2016-05-27fix the remaining testsScott Moser
2016-05-27fix a bunch of the testsScott Moser
2016-05-27merge from trunkScott Moser
2016-05-27fix pyflakes and some pylint errors/warningsScott Moser
2016-05-27fix pyflakes, move datasources= to bottomScott Moser
2016-05-26Move sdc:nics to a JSON map. Add unittest for sdc:nicsRyan Harper
2016-05-26Add smartos sdc:nics converter and network_config property for smartos ↵Ryan Harper
configdrive
2016-05-26fix typos in namesScott Moser
2016-05-26config drive: log where network config came fromScott Moser
2016-05-25commit to push for fear of loss.Scott Moser
== background == DataSource Mode (dsmode) is present in many datasources in cloud-init. dsmode was originally added to cloud-init to specify when this datasource should be 'realized'. cloud-init has 4 stages of boot. a.) cloud-init --local . network is guaranteed not present. b.) cloud-init (--network). network is guaranteed present. c.) cloud-config d.) cloud-init final 'init_modules' [1] are run "as early as possible". And as such, are executed in either 'a' or 'b' based on the datasource. However, executing them means that user-data has been fully consumed. User-data and vendor-data may have '#include http://...' which then rely on the network being present. boothooks are an example of the things run in init_modules. The 'dsmode' was a way for a user to indicate that init_modules should run at 'a' (dsmode=local) or 'b' (dsmode=net) directly. Things were further confused when a datasource could provide networking configuration. Then, we needed to apply the networking config at 'a' but if the user had provided boothooks that expected networking, then the init_modules would need to be executed at 'b'. The config drive datasource hacked its way through this and applies networking if *it* detects it is a new instance. == Suggested Change == The plan is to 1. incorporate 'dsmode' into DataSource superclass 2. make all existing datasources default to network 3. apply any networking configuration from a datasource on first boot only apply_networking will always rename network devices when it runs. for bug 1579130. 4. run init_modules at cloud-init (network) time frame unless datasource is 'local'. 5. Datasources can provide a 'first_boot' method that will be called when a new instance_id is found. This will allow the config drive's write_files to be applied once. Over all, this will very much simplify things. We'll no longer have 2 sources like DataSourceNoCloud and DataSourceNoCloudNet, but would just have one source with a dsmode. == Concerns == Some things have odd reliance on dsmode. For example, OpenNebula's get_hostname uses it to determine if it should do a lookup of an ip address. == Bugs to fix here == http://pad.lv/1577982 ConfigDrive: cloud-init fails to configure network from network_data.json http://pad.lv/1579130 need to support systemd.link renaming of devices in container http://pad.lv/1577844 Drop unnecessary blocking of all net udev rules
2016-05-19Fix up tests and flake8 warningsJoshua Harlow
2016-05-19Remerge against head/masterJoshua Harlow
2016-05-19Adjust net module to be more isolatedJoshua Harlow
This allows it to be used outside of cloudinit more easily in the future.
2016-05-16Fix slow testsJoshua Harlow
Timeouts and retries were triggering so make it so that tests do not use the typical timesouts and retries so that the tests finish faster.
2016-05-12fix last flake8 errorScott Moser
2016-05-12run flake8 instead of pyflakes in tox. expect tests/ to pass flake8.Scott Moser
2016-05-12Fix up a ton of flake8 issuesJoshua Harlow
2016-05-11Use a fake serial module that will allow tests to contineJoshua Harlow
Instead of aborting all serial using tests instead just create a serial module in cloudinit that will create a fake and broken serial class when pyserial is not actually installed. This allows for using the datasource and tests that exist in a more functional and tested manner (even when pyserial is not found).
2016-05-11Fix py26 for rhel (and older versions of python)Joshua Harlow
2016-05-05Add the bridge net typeJoshua Harlow
2016-05-05Work on refactoring (and adding) network conversion testsJoshua Harlow
2016-05-01initial commit of reworkScott Moser
2016-04-29Config Drive: fix check_instance_id signature.Scott Moser
After reboot cloud-init would fail as the previously pickled object would have a check_instance_id signature but it didn't match expected LP: #1575055