~smoser/cloud-init:cleanup/consistent-exception_cb

Last commit made on 2018-03-23
Get this branch:
git clone -b cleanup/consistent-exception_cb https://git.launchpad.net/~smoser/cloud-init
Only Scott Moser can upload to this branch. If you are Scott Moser please log in for upload directions.

Branch merges

Branch information

Name:
cleanup/consistent-exception_cb
Repository:
lp:~smoser/cloud-init

Recent commits

42a9b8e... by Scott Moser

Make exception_cb consistent in readurl and wait_for_url.

This message needs improving.

68d798b... by Scott Moser

tests: remove jsonschema from xenial tox environment.

Ubuntu 16.04 (xenial) does not have jsonschema installed by default. As
it is listed in requirements, the tox environment will always have it
installed.

Add the helper tools/pipremove that removes pip packages. Then use that
to remove jsonschema without noise of always running and ignoring a
'pip uninstall jsonschema'.

0c2f1ea... by Scott Moser

tests: Fix newly added schema unit tests to skip if no jsonschema.

The recently added snap and ubuntu_advantage modules had unit tests
that exercised jsonschema. Those throw error if jsonschema is
not present. Fix to skip in that scenario.

10065b1... by Scott Moser

ec2: Adjust ec2 datasource after exception_cb change.

The recent change to exception_cb missed this caller.
The result was a slow test.

2d618e2... by Douglas Jordan

Reduce AzurePreprovisioning HTTP timeouts.

Reducing timeout to 1 second as IMDS responds within a handful
of milliseconds. Also get rid of max_retries to prevent exiting
out of polling loop early due to IMDS outage / upgrade.

Reduce Azure PreProvisioning HTTP timeouts during polling to
avoid waiting an extra minute.

LP: #1752977

097a296... by Kurt Garloff

Revert the logic of exception_cb in read_url.

In commit e9e8616, there was an inversion of the logic of the
exception_cb return value meaning, breaking the (network) OpenStack
DataSource, which implemented exception_cb as should_retry_cb, returning
True when a retry should be done and False when the retry loop should
be broken and the exception reraised again immediately.

The OpenStack DS was the only user of this callback at the time and not
touched by the commit (nor did the commit message mention an intended
change), so this almost certainly happened by mistake.

These days, we have a second user of the callback in DataSourceScaleway.
It uses the new logic, so it needs change if we fix the meaning of the
return value.

This patch reverts the meaning of url_helper.read_url() execption_cb
to the old semantics. It updates the comment and adjusts the Scaleway
datasource.

The patch has been tested on Open Telekom Cloud (which uses the
OpenStack network Datasource) where previously a missing user_data
and network_data.json would be retried 6 times each despite them
not being present (they are optional!) and the server repsonding
with a correct 404. After the patch, boot times are 10s faster,
as we no longer pointlessly retry these files.

LP: #1702160
LP: #1298921

0d51e91... by Chad Smith

ubuntu-advantage: Add new config module to support ubuntu-advantage-tools

ubuntu-advantage-tools is a package for enabling and disabling extended
support services such as Extended Security Maintenance (ESM), Canonical
Livepatch and FIPS certified PPAs. Simplify Ubuntu Advantage setup on
machines by allowing users to provide a list of ubuntu-advantage commands
in cloud-config.

d29eecc... by Ryan Harper

Handle global dns entries in netplan

In network config v1 format, there are dns values which are not bound to a
specific interface and do not map to the per-interface format in netplan.
To handle this case we render netplan configuration that duplicates the
DNS configuration on any interface that has a static network config. We
avoiding interfaces which have DHCP configuration which may provide
conflicting DNS values.

LP: #1750884

7713713... by Kurt Garloff

Identify OpenTelekomCloud Xen as OpenStack DS.

Open Telekom Cloud gen1 (Xen) hosts do not provide nova product
names in DMI but Xen HVM domU. They can however be safely identified
by the OpenTelekomCloud Chassis asset tag. OpenTelekomCloud does
use the network OpenStack DataSource, so we better detect it.

LP: #1756471

685f990... by Chad Smith

datasources: fix DataSource subclass get_hostname method signature

DataSource.get_hostname call signature changed to allow for metadata_only
parameter. The metadata_only=True parameter is passed to get_hostname
during init-local stage in order to set the system hostname if present in
metadata prior to initial network bring up.

Fix subclasses of DataSource which have overridden get_hostname to allow
for metadata_only param.

LP: #1757176