summaryrefslogtreecommitdiff
path: root/cloudinit/sources
AgeCommit message (Collapse)Author
2012-09-24DataSourceMAAS: if a oauth request fails due to 403 try updating local timeScott Moser
In the event of a 403 (Unauthorized) in oauth, try set a 'oauth_clockskew' variable. In future headers, use a time created by 'time.time() + self.oauth_clockskew'. The idea here is that if the local time is bad (or even if the server time is bad) we will essentially use something that should be similar to the remote clock. This fixes LP: #978127. LP: #978127
2012-09-24fix make pep8Scott Moser
2012-09-14Fix hostname derived from IP. (LP: 1050962)Andy Grimm
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-27For the userdata 'post-filtering' add in a new folder thatJoshua Harlow
can contain filters that serve this purpose only and add in the initial launch-index filter and replace the code in the datasource class that previously did this.
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-26Fix tests running and add in a check on the content typeJoshua Harlow
before we look into the payload as well as make the skip test a function that the datasource module can also use.
2012-08-26Don't use the processed userdata if nothing is there.Joshua Harlow
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-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 the userdata population in DataSourceNoneScott Moser
Fix the userdata being populated to a dict (incorrect) and let it instead be populated by the userdata processor with the raw userdata (either empty or datasource config provided).
2012-08-22merge from trunk for pep8 fixesScott Moser
2012-08-22fix pep8 complaints.Scott Moser
make pep8 now is silent on precise's pep8 ( 0.6.1-2ubuntu2).
2012-08-22Fix the userdata being populated to a dict (incorrect)Joshua Harlow
and let it instead be populated by the userdata processor with the raw userdata (either empty or datasource config provided).
2012-08-22return results from datasource.get_package_mirror_infoScott Moser
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-08-20Remove the matching of the filesystem dep andJoshua Harlow
add in the ability to use any fallback userdata or metadata found in the datasource config (if provided).
2012-08-19Add a 'none' datasource as a last resort fallbackJoshua Harlow
1. This will allow a basically empty datasource to be activated (as the last datasource) when no other datasources work. This allows modules to still run (if they can, new function added to the datasource if modules want to check if cloud-init is in this 'disconnected' state).
2012-08-14Add RHEVm and vSphere support as datasource AltCloudScott Moser
These changes add a new data source to cloud-init to support passing user data to RHEVm and vSphere. The user data is passed to RHEVm v3.0 (current version) using a floppy injection hook and to vSphere via cdrom device. RHEVm v3.1 will use a method similar to vSphere. Once available support for that is also expected.
2012-08-10Address review feedback for:Joe VLcek
https://code.launchpad.net/~joev-n/cloud-init/altcloud-changes/+merge/116542/comments/255564 https://code.launchpad.net/~joev-n/cloud-init/altcloud-changes/+merge/116542/comments/255565
2012-08-08Address review feedback for:Joe VLcek
https://code.launchpad.net/~joev-n/cloud-init/altcloud-changes/+merge/116542
2012-08-06re-add the 'main' routine to DataSourceMAAS.pyScott Moser
the main function, which was usable for debugging maas was dropped during the rework branch. I'm adding it back here as it is very useful. It is possibly better implemented some other way than this, but this is good enough.
2012-07-23pep8, pylint... AltCloud source changesJoe VLcek
2012-07-20Add retry logic to DataSourceAltCloudJoe VLcek
2012-07-17Added RHEVm and vSphere support as source AltCloudJoe VLcek
2012-07-16DataSourceEc2: fix bad usage of log that caused traceScott Moser
2012-07-12DataSourceOVF: again fix broken commitScott Moser
2012-07-12fix bad variable. should be 'LOG', not 'log'Scott Moser
2012-07-12DataSourceOVF: do not log exception on failed mountScott Moser
during datasourceovf looking for a transport, the failed mounts were having exceptions logged (triggering an unneccessary warning also)
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-23Fix a bunch of == None casesharlowja
2012-06-21Ensure that calling the urls happens in a specified order.Joshua Harlow
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-201. Add an importer function that will search for a given module in a set of ↵Joshua Harlow
search module 'prefixes' that also has a potential set of required attributes. 2. Use this new importer to find the distro class, the userdata handler modules, the config modules and the datasource modules, if none can be found error out accordingly.
2012-06-20Massive pylint + pep8 fixups!Joshua Harlow
2012-06-20Change to import error instead of runtime error.Joshua Harlow
2012-06-19Fix pylint line length issues.Joshua Harlow
2012-06-19Cleanup no datasource exception to use cleaner csv list.Joshua Harlow
2012-06-19Cleanup some of the logging (its a little to verbose).Joshua Harlow
2012-06-19Syntax + comment cleanups.Joshua Harlow
2012-06-19Add the ability to check if the metadata service is up before actually using it.Joshua Harlow
1. This is very useful for testing (until we have boto timeout in a more sane manner)
2012-06-181. Fixed datasource construction (switched param order)Joshua Harlow
2. Fixed up importing of modules to handle the failure case better a. Also realized that using the import class we don't have to reimport a module via getattr, so removed that.