Age | Commit message (Collapse) | Author |
|
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.
|
|
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.
|
|
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.
|
|
This commit includes the content of that commit, plus a fix for the tests
(provided by Phil).
|
|
This change broke tox tests.
|
|
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
|
|
|
|
Also implement DataSource.region for EC2 and GCE data sources.
|
|
|
|
|
|
|
|
|
|
|
|
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.
|
|
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.
|
|
|
|
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
|
This just adds user-data in 'instance/attributes/user-data'.
Also turns retries to 0 on all other things.
|
|
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.
|
|
|
|
Got removed somehow
|
|
|
|
|