~chad.smith/cloud-init:cleanup/tox-ordered-ci-deps

Last commit made on 2018-06-07
Get this branch:
git clone -b cleanup/tox-ordered-ci-deps https://git.launchpad.net/~chad.smith/cloud-init
Only Chad Smith can upload to this branch. If you are Chad Smith please log in for upload directions.

Branch merges

Branch information

Name:
cleanup/tox-ordered-ci-deps
Repository:
lp:~chad.smith/cloud-init

Recent commits

13193e4... by Chad Smith

ci: ordered tox dependencies for pylxd install

The pylxd project has a setup.py which defines install dependencies.
Those sub-dependendencies include pbr and requests which in turn have
package version conflicts. Since tox doesn't order dependencies installed,
serially install pinned urllib3 at 1.22 which supports both pbr deps and
requests deps of pylxd.

bbcc5e8... by Robert Schweikert

util: add get_linux_distro function to replace platform.dist

Allow the user to set the distribution with --distro argument to setup.py.
Fall back is to read /etc/os-release. Final backup is to use
platform.dist() Python function. The platform.dist() function is
deprecated and will be removed in Python 3.7

LP: #1745235

4ba4639... by Scott Moser

pyflakes: fix unused variable references identified by pyflakes 2.0.0.

A newer version of pyflakes (2.0.0) was released.
It identifed some unused variables that version 1.6.0 did not identify.
The change here merely fixes those unused variables.

ae02c36... by Robert Schweikert

- Do not use the systemd_prefix macro, not available in this environment

f1cff69... by Chad Smith

doc: Add config info to ec2, openstack and cloudstack datasource docs

Also document instance-data.json on the top-level datasource topic page.

3f99f4a... by Dan McDonald <email address hidden>

Enable SmartOS network metadata to work with netplan via per-subnet routes

- Updated datadict reference URL
- Store sdc:routes metadata in DatasourceSmartOS
- Map sdc:routes values to per-interface subnet configuration
- Added unittest

Co-authored-by: Mike Gerdts <email address hidden>

LP: #1763512

cd1de5f... by Chad Smith

openstack: Allow discovery in init-local using dhclient in a sandbox.

Network has not yet been configured in the init-local stage so the
openstack datasource will use dhcp-client to temporarily obtain an ipv4
address and query the metadata service at http://169.254.169.254 to get
network_data.json configuration. If present, the datasource will return
network_config version 1 config based on that network_data.json content.
Previously OpenStack datasource only setup dhcp on the fallback interface
so this represents a change in behavior to react to the full config
provided by openstack.

Also significant to OpenStack is the separation of a _crawl_data operation
from get_data(). crawl_data walks the available metadata services and
returns a dict of discovered content. get_data consumes the crawled_data,
 caches it in the datasource and reacts to that data.
/run/cloud-init/instance-data.json now published network_data.json or
ec2_metadata key if that data is present on any datasource.

The main reasons for the separation of crawl from get_data:
 * Enable performance metrics of cloud-init's metadata crawls on each
 * Enable cloud-init modules and scripts to query and consume metadata
   content which may have updated/changed after cloud-init's initial cache
   during instance boot. (Think hotplug)

Also generalize common logic to base DataSource class/module:
 * Move to a common UNSET variable up into base datasource module fix EC2,
   ConfigDrive, OpenStack, SmartOS to use the global.
 * Drop get_url_settings from Ec2, CloudStack and OpenStack and generalize
   DataSource.get_url_params(). Allow subclasses to override url_max_wait,
   url_timeout and url_retries params.
 * Rename get_network_metadata bool to perform_dhcp_setup as it designates
   whether EphemeralDHCPv4 setup is required before crawling metadata.

LP: #1749717

12799d9... by Scott Moser

tests: Avoid using https in httpretty, improve HttPretty test case.

On OpenSuSE 42.3, we would get errors running
tests/unittests/test_handler/test_handler_chef.py
 - test_myhttps_nonet raises a UnmockedError
   No mocking was registered, and real connections are not allowed
 - test_myhttps_net raises SSLError
   ("bad handshake: SysCallError(32, 'EPIPE')",)

This fixes the errors by just using http instead of https.

Also it modifies the HttprettyTestCase to do the httpretty activate
and deactivate itself in setUp and tearDown. Then we don't have to
decorate individual test_ methods. Also, we set
   httpretty.HTTPretty.allow_net_connect = False
Test cases here should not reach out to a network resource.

LP: #1771659

3b28bdc... by Chad Smith

yaml_load/schema: Add invalid line and column nums to error message

Yaml tracebacks are generally hard to read for average users. Add a bit of
logic to util.yaml_load and schema validation to look for
YAMLError.context_marker or problem_marker line and column counts.

No longer log the full exceeption traceback from the yaml_load error,
instead just LOG.warning for the specific error and point to the offending
line and column where the problem exists.

aa4eeb8... by Paul Meyer

Azure: Ignore NTFS mount errors when checking ephemeral drive

The Azure data source provides a method to check whether a NTFS partition
on the ephemeral disk is safe for reformatting to ext4. The method checks
to see if there are customer data files on the disk. However, mounting
the partition fails on systems that do not have the capability of
mounting NTFS. Note that in this case, it is also very unlikely that the
NTFS partition would have been used by the system (since it can't mount
it). The only case would be where an update to the system removed the
capability to mount NTFS, the likelihood of which is also very small.
This change allows the reformatting of the ephemeral disk to ext4 on
systems where mounting NTFS is not supported.