~mgerdts/cloud-init:update_metadata

Last commit made on 2018-07-20
Get this branch:
git clone -b update_metadata https://git.launchpad.net/~mgerdts/cloud-init
Only Mike Gerdts can upload to this branch. If you are Mike Gerdts please log in for upload directions.

Branch merges

Branch information

Name:
update_metadata
Repository:
lp:~mgerdts/cloud-init

Recent commits

b7b135b... by Mike Gerdts

fix python 2.6

7f602de... by Mike Gerdts

update_metadata re-config on every boot comments and tests not quite right

The comment in update_metadata() that explains how a datasource should enable
network reconfig on every boot presumes that EventType.BOOT_NEW_INSTANCE is a
subset of EventType.BOOT. That's not the case, and as such a datasource that
needs to configure networking when it is a new instance and every boot needs to
include both event types.

To make the situation above easier to debug, update_metadata() now logs when it
returns false.

To make it so that datasources do not need to test before appending to
the update_events['network'], it is changed from a list to a set.

test_update_metadata_only_acts_on_supported_update_events is updated to allow
datasources to support EventType.BOOT.

d41cc82... by Chad Smith

get_linux_distro: add support for centos6 and rawhide flavors of redhat

An empty /etc/os-release exists on some redhat images, most notably
the COPR build images of centos6 and rawhide. On platforms missing
/etc/os-release or having an empty /etc/os-release file, use
_parse_redhat_release on rhel-based images to obtain distribution and
release codename information.

LP: #1781229

b07e491... by Scott Moser

tools: add '--debug' to tools/net-convert.py

In order to see some of the WARNING messages added by bug 1774666
I wanted logging output of tools/net-convert. This does:

a.) add '--debug' and make it print the network state and read yaml only
    if --debug is provided.
b.) set up basic logging so warnings goes to console by default and
    debug goes to console if --debug is provided.

90e3ade... by Scott Moser

tests: bump the version of paramiko to 2.4.1.

Paramiko version 2.4.0 had a CVE (CVE-2018-7750) against it.
It is not likely particularly worrisome for our integration tests,
but we might as well bump it.

2e62cb8... by Chad Smith

docs: note in rtd about avoiding /tmp when writing files

LP: #1727876

c1a75a6... by Chad Smith

ubuntu,centos,debian: get_linux_distro to align with platform.dist

A recent commit added get_linux_distro to replace the deprecated python
platform.dist module behavior before it is dropped from python. It added
behavior that was compliant on OpenSuSE and SLES, by returning
(<distro_name>, <distro_version>, <cpu-arch>).

Fix get_linux_distro to behave more like the specific distribution's
platform.dist on ubuntu, centos and debian, which will return the
distribution release codename as the third element instead of <cpu-arch>.

SLES and OpenSUSE will retain their current behavior.

Examples follow:
('sles', '15', 'x86_64')
('opensuse', '42.3', 'x86_64')
('debian', '9', 'stretch')
('ubuntu', '16.04', 'xenial')
('centos', '7', 'Core')

LP: #1780481

802c1d5... by Marc Tamsky <email address hidden>

Fix boothook docs on environment variable name (INSTANCE_I -> INSTANCE_ID)

be9ecc1... by Chad Smith

update_metadata: a datasource can support network re-config every boot

Very basic type definitions are now defined to distinguish 'boot'
events from 'new instance (first boot)'. Event types will now be handed
to a datasource.update_metadata method which can determine whether
to refresh its metadata and re-render configuration based on that
source event.

A datasource can 'subscribe' to an event by setting up the update_events
attribute on the datasource class which describe what config scope is
updated by a list of matching events. By default datasources will have
the following update_events: {'network': [EventType.BOOT_NEW_INSTANCE]}
This setting says the datasource will re-write network configuration only
on first boot of a new instance or when the instance id changes.

New methods are now present on the datasource:
  - clear_cached_attrs: Resets cached datasource attributes to values
    listed in datasource.cached_attr_defaults. This is performed prior to
    processing a fresh metadata process to avoid keeping old/invalid
    cached data around.
  - update_metadata: accepts source_event_types to determine if the
    metadata should be crawled again and processed

5858136... by Scott Moser

tests: drop salt-minion integration test

The salt minion integration test as we had it did not do a whole lot
more than the unit tests on that module did. Additionally, it caused
some transient failures at least in Ubuntu 18.04.

At a future date we may choose to add an integration test that installs
salt-minion and salt server and configures it to be a better test.

LP: #1778737