summaryrefslogtreecommitdiff
path: root/cloudinit/sources/DataSourceEc2.py
AgeCommit message (Collapse)Author
2012-11-12pep8 and pylint fixupsScott Moser
2012-11-12merge from trunkScott Moser
2012-11-07remove dead code from DataSourceEc2Scott Moser
2012-10-24Remove function that shouldn't have shown up.Joshua Harlow
2012-10-24Handle the case where newer versions of botoJoshua Harlow
are used that lazily load the metadata from the ec2 metadata service. 1. Add a ec2_utils module that checks which version of boto is being used and under the right versions the metadata dictionary will be expanded. 2. Use this new ec2_utils module in the cloudstack and ec2 datasources as there entrypoints into boto.
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-08-31support launch index specific user-dataJoshua Harlow
EC2 and openstack provide 'launch_index' in their metadata. This allows the user to specify cloud-config or multipart mime data that includes the 'Launch-Index' header. If launch index is available in the metadata service, then: * any part that contains a launch index other than the current launch-index of this instance will be ignored. * any part that does not contain a launch index will be considered as for this instance. If there is no such header, or launch_index is not available in the metadata service, then no such filtering will be done. LP: #1023177
2012-08-27DataSourceEc2: require 'instance-data' as top level domainScott Moser
In searching for the metadata service, require 'instance-data' to be at the top level domain. Previously any misconfigured 'search' in /etc/resolv.conf could result in unintended use of a metadata server. LP: #1040200
2012-08-27Update so that the content types searched for launch-indexJoshua Harlow
variable has a little more meaning and by default look in metadata for 'launch-index' and have ec2 instead look for a different variable (thus allowing more datasources to just work).
2012-08-26Add the capability to understand and filter onJoshua Harlow
userdata based on a launch-index (or leave userdata alone if none is provided by the datasource). This works by doing the following. 1. Adjusting the userdata processor to attempt to inject a "Launch-Index" header into the messages headers (by either taking a header that already exists or by looking into the payload to see if it exists there). 2. Adjust the get_userdata ds function to apply a filter on the returned userdata (defaulting to false) that will now use the datasources get_launch_index value to restrict the 'final' message used in consuming user data (the same behavior if not existent). 3. Further down the line processes that use the 'resultant' userdata now will only see the ones for there own launch index (ie cloud-config will be restricted automatically and so on) and are unaffected (although they can now ask the cloud object or the datasource for its launch index via the above new ds method.
2012-08-22rework package mirror selectionScott Moser
There are several changes here. * Datasource now has a 'availability_zone' getter. * get_package_mirror_info * Datasource convenience 'get_package_mirror_info' that calls the configured distro, and passes it the availability-zone * distro has a get_package_mirror_info method * get_package_mirror_info returns a dict that of name:mirror this is to facilitate use of 'security' and 'primary' archive. * this supports searching based on templates. Any template that references undefined values is skipped. These templates can contain 'availability_zone' (LP: #1037727) * distro's mirrors can be arch specific (LP: #1028501) * rename_apt_lists supports the "mirror_info" rather than single mirror * generate_sources_list supports mirror_info, and as a result, the ubuntu mirrors reference '$security' rather than security (LP: #1006963) * remove the DataSourceEc2 specific mirror selection, but instead rely on the above filtering, and the fact that 'ec2_region' is only defined if the availability_zone looks like a ec2 az.
2012-07-16DataSourceEc2: fix bad usage of log that caused traceScott Moser
2012-07-09fix 'make pylint' warningsScott Moser
On my system (quantal) this 'make pylint' does not complain now.
2012-07-09DataSourceEc2: only do dns check in mirror selectionScott Moser
This returns the check for an archive mirror in the DataSourceEc2 to only do so by DNS resolution. The 'rework' branch had made the check wait and timeout on attempts to reach the mirror. This resulted in 120 seconds of waiting before failure. For now, just go back to the old situation of checking by dns.
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-19Syntax + comment cleanups.Joshua Harlow
2012-06-16Fix pylint line length to big issue.Joshua Harlow
2012-06-16Adjust the usage of map items() to iteritems() which will help later ↵Joshua Harlow
translation to python 3.
2012-06-15Complete cleanup for refactoring/rework that makes it comptabile with the ↵Joshua Harlow
new structure, using unified util functions, logging and eliminating code and calls.
2012-06-07Darn it. Those shouldn't be there!Joshua Harlow