Last commit made on 2018-02-07
Get this branch:
git clone -b bug-1667735 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


Recent commits

d40a3dc... by Mike Gerdts

DataSourceSmartOS: list() should always return a list

    If customer_metadata has no keys, the KEYS request returns an empty string.
    Callers of the list() method expect a list to be returned and will give a
    stack trace if this expectation is not met.

    LP: #TBD

e78a842... by Mike Gerdts

DataSourceSmartOS: hang when metadata service is down

    If the metadata service in the host is down while a guest that uses
    DataSourceSmartOS is booting, the request from the guest falls into the bit
    bucket. When the metadata service is eventually started, the guest has no
    awareness of this and does not resend the request. This results in
    cloud-init hanging forever with a guest reboot as the only recovery option.

    This fix updates the metadata protocol to implement the initialization
    phase, just as is implemented by mdata-get and related utilities. The
    initialization phase includes draining all pending data from the serial
    port, writing an empty command and getting an expected error message in
    reply. If the initialization phase times out, it is retried every five
    seconds. Each timeout results in a warning message: "Timeout while
    initializing metadata client. Is the host metadata service running?" By
    default, warning messages are logged to the console, thus the reason for a
    hung boot is readily apparent.

    LP: #1667735

67cd602... by Mike Gerdts

DataSourceSmartOS: add locking and retries

    cloud-init and mdata-get each have their own implementation of the SmartOS
    metadata protocol. If cloud-init and other services that call mdata-get are
    run concurrently, crosstalk on the serial port can cause them both to become

    This change makes it so that cloud-init uses the same cooperative locking
    scheme that's used by mdata-get, thus preventing cross-talk between
    mdata-get and cloud-init. To provide some level of protection against
    others that may generate noise on the serial port, a retry mechanism is also

    For testing, pyserial is required. bddeb was changed to pass the proper
    option to read-dependencies so that the renames in pkg-deps.json are

    LP: #1746605

f7deaf1... by Chad Smith

docs: Update RTD content for cloud-init subcommands.

Give a bit more detailed information which others can quickly reference to
discover new CLI subcommand functionality. This section was a bit stale as
we've introduced cloud-init status, clean and analyze content that was a
bit under represented. Since we've had a few request of externals who try
to run cloud-init subcommands on the commandline instead of rebooting,
it's probably worth a bit of content here to describe how those init and
module subcommands work.

5e5dc97... by Scott Moser

OVF: Extend well-known labels to include OVFENV.

Fujitsu Cloud Service attaches a ovf iso transport with a label
'OVFENV'. This seems to be a reasonable value as a label.

While the for bug 1731868 would likely fix cloud-init on fujitsu
cloud, this change will find it faster.

LP: #1698669

1d8c327... by Chad Smith

Fix potential cases of uninitialized variables.

While addressing undeclared variable in 'cloud-init status', I also fixed
the errors raised by automated code reviews against cloud-init master at

The following items are addressed:

 * Fix 'cloud-init status':
    * Only report 'running' state when any stage in
      /run/cloud-init/status.json has a start time but no finished time.
      Default start time to 0 if null.
    * undeclared variable 'reason' now reports 'Cloud-init enabled by
      systemd cloud-init-generator' when systemd enables cloud-init

 * cc_rh_subscription.py util.subp return values aren't set during if an
   exception is raised, use ProcessExecution as e instead.

 * distros/freebsd.py:
   * Drop repetitive looping over ipv4 and ipv6 nic lists.
   * Initialize bsddev to 'NOTFOUND' in the event that no devs are
   * declare nics_with_addresses = set() in broader scope outside
     check_downable conditional

 * cloudinit/util.py: Raise TypeError if mtype parameter isn't string,
   iterable or None.

LP: #1744796

bc84f50... by Scott Moser

tests: Collect script output as binary, collect systemd journal, fix lxd.

This adds collection a gzip compressed systemd journal on systemd systems.
The file can later be reviewed with:
  zcat system.journal.gz > system.journal
  journalctl --file=system.journal [-o short-monotonic ..]

To support this:
  * modify test harness infrastructure to not assume content is utf-8.
  * fix lxd platform to support make '_execute' return bytes rather
    than a string. https://github.com/lxc/pylxd/issues/268

Also switched the base collectors to use /bin/sh as others already did.

bccee93... by Scott Moser

HACKING.rst: mention setting user name and email via git config.

Just include mention of setting user name and email when first
setting up git.

c03bdd3... by Douglas Jordan

Azure VM Preprovisioning support.

This change will enable azure vms to report provisioning has completed
twice, first to tell the fabric it has completed then a second time to
enable customer settings. The datasource for the second provisioning is
the Instance Metadata Service (IMDS),and the VM will poll indefinitely for
the new ovf-env.xml from IMDS.

This branch introduces EphemeralDHCPv4 which encapsulates common logic
used by both DataSourceEc2 an DataSourceAzure for temporary DHCP
interactions without side-effects.

LP: #1734991

30597f2... by Scott Moser

tools/read-version: Fix read-version when in a git worktree.

read-version --json would report bad data when working in a worktree.
This is just because in a worktree, .git is not a directory, but
rather a metadata file that points to the another path.
  $ git worktree ../mytree
  $ cat ../mytree/.git
  gitdir: /path/to/cloud-init/.git/worktrees/mytree
  $ rm -Rf ../mytree; git worktree prune