summaryrefslogtreecommitdiff
path: root/cloudinit/sources/DataSourceConfigDrive.py
AgeCommit message (Collapse)Author
2014-09-22merge from trunkScott Moser
2014-09-10Openstack: Vendor data cleanupScott Moser
For now, this vendor data handling is just added to openstack. However, in an effort to allow sanely handling of multi-part vendor-data that is namespaced, we add openstack.convert_vendordata_json . That basically takes whatever was loaded from vendordata and takes the 'cloud-init' key if it is a dict. This way the author can namespace cloud-init, basically telling it to ignore everything else.
2014-09-10drop version= from readersScott Moser
instead of taking a version that they should look for, the readers now just select the highest supported version. definitely a use case later for having version= but nothing is using it now.
2014-09-10make BaseReader select latest supported versionScott Moser
2014-09-10Only use vendordata under cloud-init key for ConfigDriveJay Faulkner
This data will be treated the same as vendordata from other sources.
2014-09-08Update read_config_drive to use OS_VERSIONS tuple for readersJay Faulkner
Updated read_config_drive: removed the unused version kwarg, used the OS_VERSIONS tuple from the openstack helper to avoid hardcoding versions. Added a comment to the tuple in helpers/openstack.py asking for it to be kept in chronological order.
2014-08-26Refactor vendor_data handlingJay Faulkner
vendor_data is guaranteed to be a dict if it exists; if it doesn't exist ensure it's represented by an empty dict to avoid checking it to see if it's a dict.
2014-08-26Add failback for older Openstack configdrive versionsJay Faulkner
- Also utilizing the constants defined in cloudinit/sources/helpers/openstack.py for configdrive versions
2014-08-26Upgrade configdrive versionJay Faulkner
- Upgrade configdrive to use 2013-10-17 - Fix issue with vendor_data.json parsing Co-Authored-By: Paul Querna <pquerna@apache.org>
2014-08-18fix: Updated some syntax to be pep8 compliantJoseph Bajin
2014-08-18new: Added FreeBSD support to ConfigDriveJoseph Bajin
2014-02-24ConfigDrive: trim trailing newlines in previous-instance-idScott Moser
When cloud-init writes previous-instance-id, it does so with a trailing '\n'. This isn't ideal, as other readers also have to know that this will have a trailing '\n' on it, but here we just trim that off.
2014-02-24Ensure we strip the previous_iid file contentsJoshua Harlow
The instance-id file contains the instance id and a newline, to compare correctly make sure we strip the newline before further usage.
2014-02-08Capture IOError and use LOG betterJoshua Harlow
2014-02-07Remerged with trunkJoshua Harlow
2014-02-01Add a openstack specific datasourceJoshua Harlow
Openstack has a unique derivative datasource that is gaining usage. Previously the config drive datasource provided part of this functionality as well as the ec2 datasource, but since new functionality is being added to openstack is seems benefical to combine the used parts into one datasource just made for handling openstack deployments. This patch factors out the common logic shared between the config drive and the openstack metadata datasource and places that in a shared helper file and then creates a new openstack datasource that readers from the openstack metadata service and refactors the config drive datasource to use this common logic.
2014-01-09Allow a Config Drive source on a partition, if the label matches.Paul Querna
2013-09-03Review adjustments.Joshua Harlow
2013-09-02Ensure data is initialized to a dict if its empty/noneJoshua Harlow
LP: #1198297
2013-09-02Add config drive support for random_seedJoshua Harlow
A new field in the metadata has emerged, one that provides a way to seed the linux random generator. Add support for writing the seed and rewrite parts of the on_boot code to use a little helper class. LP: #1198297
2013-06-04support optical drives with dev node /dev/sr1Greg Padgett
Extend a prior fix which helped discovery of media on systems using 2.6 kernels. /dev/sr0 covers only some of the use cases, /dev/sr1 is also common.
2013-03-26compatibility fixes for Fedora and RHELGreg Padgett
This patch fixes issues in Fedora 18 (and upcoming RHEL 7) which are present due to their use of systemd: - store locale configuration in /etc/locale.conf - store hostname in /etc/hostname - use a symlink for /etc/localtime (prior code would set the timezone but corrupt data in /usr/share/zoneinfo due to presence of symlink) It also contains fixes for issues unrelated to systemd adoption: - explicitly scan /dev/sr0 with blkid in order to get the optical drive in the blkid cache. This prevents an issue on systems running 2.6 kernels (such as RHEL 6) in which config disks on some devices won't be detected unless the device has previously been queried. (For reference, see https://patchwork.kernel.org/patch/1770241/) - append a newline when rewriting sysconfig files, as this is customary text configuration file formatting and is expected by some parsers (such as the ifcfg-rh plugin for NetworkManager)
2013-03-07merge from trunkScott Moser
2013-03-06Make conf.d and the default merging use the new merging algos.Joshua Harlow
2013-03-06Continue working on merging code.Joshua Harlow
2013-01-16DataSourceConfigDrive: consider CD rom as valid config-drive source.Scott Moser
previously, there was an attempt in the config drive source to limit the source device to a "full block device" rather than a partition. This was done by a simplistic approach of checking that the last character of the name was not a number. That was filtering out CD-rom devices (sr0). Now, we have a bit more sophisticated approach to that same problem. We filter out block devices that have a 'partition' entry in /sys/class/block/DEVICE_NAME/partition . LP: #1100545
2012-11-12config-drive-v2: support public keysScott Moser
This does a couple things: * separates out the 'normalize_public_keys' from the DataSource's get_public_ssh_keys * uses that from config-drive datasource * supports config drive v1 or v2 public-keys * adds a test. LP: #1077700
2012-11-12REVERT revno 714: config-drive-v2: populate metadata['public-keys'] from ↵Scott Moser
'public_keys'
2012-11-11config-drive-v2: populate metadata['public-keys'] from 'public_keys'Scott Moser
other datasources populate 'public-keys' rather than 'public_keys' and there is a more complete handler in the base DataSource. So, to take advantage of that, have DataSourceConfigDrive copy public_keys to public-keys, and remove the 'get_public_ssh_keys' from the DataSourcEConfigDrive. LP: #1077700
2012-10-23use only util methods for reading/loading/appending/peekingScott Moser
Use only util methods for reading/loading/appending/peeking at files since it is likely soon that we will add a new way of adjusting the root of files read, also it is useful for debugging to track what is being read/written in a central fashion.
2012-10-05Add checks around the device names that are foundJoshua Harlow
to ensure that even if they are found that they are also valid, before they are assumed to be the correct device name.
2012-10-05Add tests to show that the assigned bug is fixed.Joshua Harlow
Also fix the extraction of the metadata key name since it actually uses 'dashes' instead of being a single word.
2012-10-05Ensure that config drive datasource attempts toJoshua Harlow
translate the device name to a actual device using logic that will try the ec2 metadata (if avail) or will try using 'blkid' to find a corresponding label. LP: #1062540
2012-10-04Ensure that for config drive thatJoshua Harlow
we map 'hostname' to 'local-hostname' so that the modules work correctly with the cfgdrive style of data.
2012-09-20Use only util methods for reading/loading/appending/peekingJoshua Harlow
at files since it is likely soon that we will add a new way of adjusting the root of files read, also it is useful for debugging to track what is being read/written in a central fashion.
2012-08-24use openstack metadata version 2012-08-10 unless not availableScott Moser
If 'latest' is found, but '2012-08-10' is not, we will log a warning but attempt to use it.
2012-08-24use instance-id, not previous-instance-id.Scott Moser
at the point where we are getting the previous instance id, there cloud-init hasn't performed the move yet. Therefore, the "previous" is the one that /var/lib/cloud/data/ says is the current.
2012-08-24use 'uuid' as 'instance-id'Scott Moser
openstack metadata uses 'uuid' as an instances 'instance-id'. just copy that to the metadata['instance-id']
2012-08-24committing in preparation for actual testScott Moser
2012-08-23some more tests.Scott Moser
2012-08-23fix pep8 and pylintScott Moser
2012-08-23initial functional unit testScott Moser
2012-08-22fix pep8 complaints.Scott Moser
make pep8 now is silent on precise's pep8 ( 0.6.1-2ubuntu2).
2012-06-211. Move all info() logging methods to debug() harlowja
2. Adjust comment on sources list from depends 3. For the /etc/timezone 'writing', add a header that says created by cloud-init
2012-06-20Massive pylint + pep8 fixups!Joshua Harlow
2012-06-18Fixed the constructor paramsJoshua Harlow
2012-06-15Fixups to ensure that pylint does not find anything major wrong.Joshua Harlow
2012-06-15Update applying network esttings to use the distro function to handle this, ↵Joshua Harlow
use logexc instead of log.exception
2012-06-11Fix this up to work with new utils/logging/datasource...Joshua Harlow
2012-06-07Darn it. Those shouldn't be there!Joshua Harlow