~tomerc/cloud-init:remove-colon

Last commit made on 2018-10-18
Get this branch:
git clone -b remove-colon https://git.launchpad.net/~tomerc/cloud-init
Only Tomer Cohen can upload to this branch. If you are Tomer Cohen please log in for upload directions.

Branch merges

Branch information

Name:
remove-colon
Repository:
lp:~tomerc/cloud-init

Recent commits

3348dd7... by Tomer Cohen

remove colon from `-type: nameserver`

635fec3... by Katie McLaughlin

Correct spelling in an error message (udevadm).

Fix a typo in a RuntimeError path. (udevamd -> udevadm).

4652b19... by Chad Smith

tests: meta_data key changed to meta-data in ec2 instance-data.json

LP: #1797231

9f88125... by Chad Smith

tests: fix kvm integration test to assert flexible config-disk path

Make integration test for flexible using regexp in case disk changes.

LP: #1797199

6ee8a2c... by Chad Smith

tools: Add cloud-id command line utility

Add a quick cloud lookup utility in order to more easily determine
the cloud on which an instance is running.

The utility parses standardized attributes from
/run/cloud-init/instance-data.json to print the canonical cloud-id
for the instance. It uses known region maps if necessary to determine
on which specific cloud the instance is running.

Examples:
aws, aws-gov, aws-china, rackspace, azure-china, lxd, openstack, unknown

f0bc02d... by Chad Smith

instance-data: Add standard keys platform and subplatform. Refactor ec2.

Add the following instance-data.json standardized keys:
* v1._beta_keys: List any v1 keys in beta development,
  e.g. ['subplatform'].
* v1.public_ssh_keys: List of any cloud-provided ssh keys for the
  instance.
* v1.platform: String representing the cloud platform api supporting the
  datasource. For example: 'ec2' for aws, aliyun and brightbox cloud
  names.
* v1.subplatform: String with more details about the source of the
  metadata consumed. For example, metadata uri, config drive device path
  or seed directory.

To support the new platform and subplatform standardized instance-data,
DataSource and its subclasses grew platform and subplatform attributes.
The platform attribute defaults to the lowercase string datasource name at
self.dsname. This method is overridden in NoCloud, Ec2 and ConfigDrive
datasources.

The subplatform attribute calls a _get_subplatform method which will
return a string containing a simple slug for subplatform type such as
metadata, seed-dir or config-drive followed by a detailed uri, device or
directory path where the datasource consumed its configuration.

As part of this work, DatasourceEC2 methods _get_data and _crawl_metadata
have been refactored for a few reasons:
- crawl_metadata is now a read-only operation, persisting no attributes on
  the datasource instance and returns a dictionary of consumed metadata.
- crawl_metadata now closely represents the raw stucture of the ec2
  metadata consumed, so that end-users can leverage public ec2 metadata
  documentation where possible.
- crawl_metadata adds a '_metadata_api_version' key to the crawled
  ds.metadata to advertise what version of EC2's api was consumed by
  cloud-init.
- _get_data now does all the processing of crawl_metadata and saves
  datasource instance attributes userdata_raw, metadata etc.

Additional drive-bys:
* unit test rework for test_altcloud and test_azure to simplify mocks
  and make use of existing util and test_helpers functions.

00e36d3... by Scott Moser

net: ignore nics that have "zero" mac address.

Previously we explicitly excluded mac address '00:00:00:00:00:00'.
But then some nics (tunl0 and sit0) ended up having a mac address like
'00:00:00:00'.

The change here just ignores all 00[:00[:00...]].

LP: #1796917

638f09e... by Chad Smith

tests: fix apt_configure_primary to be more flexible

Commit d3e803ad316e6796e5d83e7e8f8f4f7224b92df9 added deb-src comments to
the cloud-init apt templates. This doubled the number of matching entries
seen in /etc/apt/sources.list in apt_configure_primary integration test.

This test was really asserting that GaTech urls were present in
/etc//apt/sources.list instead of archive.ubuntu.com. Fix the test to be a
bit more flexible in case cloud-init changes its bas apt template again.

d3e803a... by Scott Moser

Ubuntu: update sources.list to comment out deb-src entries.

Other installation modes began to comment out the deb-src lines in
/etc/apt/sources.list sometime in 16.04 time frame.

This makes the cloud-init rendered sources.list the same as that
currently present in the lxd images.

The changes here are:
 a.) comment out all 'deb-src' lines.
 b.) move security to the bottom of the file.
 c.) trim trailing white space from 3 comment lines.

LP: #74747

e280004... by Scott Moser

release 18.4

Bump the version in cloudinit/version.py to be 18.4 and update ChangeLog.

LP: #1795741