Last commit made on 2018-04-21
Get this branch:
git clone -b lp1746605 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

2b4bdbb... by Mike Gerdts

feedback from smoser: unused variable

c24efa0... by Mike Gerdts

DataSourceSmartOS: add locking

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 confused.

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.

For testing, a VM running on a SmartOS host and pyserial are required.
If the tests are run on a platform other than SmartOS, those that use a
real serial port are skipped. pyserial remains commented in
requirements.txt because most testers will not be running atop SmartOS.

LP: #1746605

4c573d0... by Mike Gerdts

DataSourceSmartOS: fix 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

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

025ddc0... by Mike Gerdts

DataSourceSmartOS: change default fs on ephemeral disk from ext3 to ext4.

ext3 is not able to support file system sizes that are needed in Joyent's
cloud. For the default block size of 4k, the maximum filesystem size
for ext3 is 2^32 * 4096 = 16 TiB.

This changes the default file system type from ext3 to ext4.

LP: #1763511

acca826... by Scott Moser

pycodestyle: Fix invalid escape sequences in string literals.

Python has deprecated these invalid string literals now
and pycodestyle is identifying them with a W605 warning.

So basically, any use of \ not followed by one of [\'"abfnrtv]
or \ooo (octal) \xhh (hex) or a newline is invalid. This is most
comomnly seen for us in regex. To solve, you either:
 a.) use a raw string r'...'
 b.) correctly escape the \ that was not intended to be interpreted.

6a979bb... by Ryan Harper

Implement bash completion script for cloud-init command line

In bash shells with bash_completion enabled, now the cloud-init
sub commands and parameters/flags will be shown.

49b562c... by Chad Smith

tools: Fix make-tarball cli tool usage for development

This tool is used to assist during the creation of ubuntu packages for
release testing. Address the following on the command-line:
 * --help option now print usage
 * Add --orig-tarball which creates named output file
 * drop unused --verbose option

4b86ab9... by Scott Moser

renderer: support unicode in render_from_file.

If a file passed to render_from_file had non-ascii text then
jinja in python2 would decode as ascii, which would cause
UnicodeDecodeError. This issue can be re-created in python2
with just:

The solution here is to explicitly pass in unicode supporting
type (py3 str, py2 unicode). Those are six.text_type.
Then jinja does not try to decode.

The reason we hit this is that load_file calls decode_binary.
decode_binary believes it has no work to do if it got a six.string_types.
  isinstance('can\xe2\x80\x99t', six.string_types) == True
So it returns the original string which will blow up for jinja.

Our fix here then is to load the file in binary mode and explicitly
decode it to utf-8. Then in python2 we'll have a unicode type
and in python3 we'll have a string type.

c6dff58... by Ryan Harper

Implement ntp client spec with auto support for distro selection

Add a base NTP client configuration dictionary and allow Distro
specific changes to be merged. Add a select client function which
implements logic to preferr installed clients over clients which
need to be installed. Also allow distributions to override the
cloud-init defaults.

LP: #1749722

0f77456... by Scott Moser

Apport: add Brightbox, IBM, LXD, and OpenTelekomCloud to list of clouds.

When filing a bug with apport, this allows the user to choose
Brightbox, IBM, LXD, or OpenTelekomCloud as their cloud.