summaryrefslogtreecommitdiff
path: root/cloudinit/sources/DataSourceGCE.py
AgeCommit message (Collapse)Author
2016-12-22LICENSE: Allow dual licensing GPL-3 or Apache 2.0Jon Grimm
This has been a recurring ask and we had initially just made the change to the cloud-init 2.0 codebase. As the current thinking is we'll just continue to enhance the current codebase, its desirable to relicense to match what we'd intended as part of the 2.0 plan here. - put a brief description of license in LICENSE file - put full license versions in LICENSE-GPLv3 and LICENSE-Apache2.0 - simplify the per-file header to reference LICENSE - tox: ignore H102 (Apache License Header check) Add license header to files that ship. Reformat headers, make sure everything has vi: at end of file. Non-shipping files do not need the copyright header, but at the moment tests/ have it.
2016-11-10pep8: fix style errors reported by pycodestyle 2.1.0Scott Moser
pycodestyle 2.1.0 is in Ubuntu zesty, and complained about the changes made here. Simple style changes. This makes 'make pep8' pass again when built in a zesty build system with proposed enabled.
2016-08-08Newer requests have strong type validationJoshua Harlow
Only use strings in headers, as newer requests actually do stricter validation of this, so ensure that we comply by only having string objects in header dicts.
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-05-12Fix up a ton of flake8 issuesJoshua Harlow
2015-07-22Add DataSource.region and use it in mirror selection.Daniel Watkins
Also implement DataSource.region for EC2 and GCE data sources.
2015-07-06Return a sensible value for DataSourceGCE.availability_zone.Daniel Watkins
2015-04-20GCE instance-level SSH keys override project-level keys. (LP: #1403617)Daniel Watkins
2015-04-20Support multiple metadata paths for metadata keys in GCE data source.Daniel Watkins
2015-04-20Rename found variable in GCE data source.Daniel Watkins
2015-04-20Refactor GCE metadata fetching to use a helper class.Daniel Watkins
2015-02-25move towards user-data being binaryScott Moser
UrlResponse: biggest change... make readurl return bytes, making user know what to do with it. util: add load_tfile_or_url for loading text file or url as read_file_or_url now returns bytes ec2_utils: all meta-data is text, remove non-obvious string translations DigitalOcean: adjust for ec2_utils DataSourceGCE, DataSourceMAAS: user-data is binary other fields are text. openstack.py: read paths without decoding to text. This is ok as paths other than user-data are json, and load_json will handle load_file still returns text, and that is what most things use.
2015-01-22Make parameter list for get_hostname method consistentMarco Morais
The sources.DataSource class has method defined as: def get_hostname(self, fqdn=False, resolve_ip=False) Make the parameter list for this method in DataSourceDigitalOcean and DataSourceGCE consistent with superclass sources.DataSource.
2015-01-16pep8 fixesScott Moser
2015-01-14Use the short name for GCE hostnames per GCE's request (LP: #1383794).Ben Howard
2015-01-06Corrected errant logging message.Wayne Witzel III
2014-12-19add user-data encoding support for gceWayne Witzel III
2014-02-14DataSourceGCE: fix 'is_resolvable', remove unnecessary WARNScott Moser
2014-02-13some style changes, some pylint, be less noisyScott Moser
this changes url_map to a list and adds 'required' information. * If we've not already found an entry, and this is required, then debug log (ie, this is just not GCE). * if we already found an entry and this is required: warn split the keys fixing out of the loop.
2014-02-13GCE: use dns name instead of IP addressVaidas Jablonskis
2014-02-13GCE: add unit tests, user-data support and few other fixesVaidas Jablonskis
2014-02-13add 'user-data' support.Scott Moser
This just adds user-data in 'instance/attributes/user-data'. Also turns retries to 0 on all other things.
2014-02-12support configuration of MD_URL, disable if not resolvable.Scott Moser
this allows the metadata url to be configured by setting: datasource: GCE: metadata_url: <value> Then also, if its not resolvable, we just deactivate the datasource quickly.
2014-02-08wrap url get call in try/except clauseVaidas Jablonskis
2014-02-07Forgot to include _trim_key functionVaidas Jablonskis
Got removed somehow
2014-02-07use url_helper instead of requestsVaidas Jablonskis
2014-02-03Add Google Compute Engine data source support.Vaidas Jablonskis