<feed xmlns='http://www.w3.org/2005/Atom'>
<title>vyos-cloud-init.git/cloudinit/tests, branch crux</title>
<subtitle> (mirror of https://github.com/vyos/vyos-cloud-init.git)
</subtitle>
<id>https://git.amelek.net/vyos/vyos-cloud-init.git/atom?h=crux</id>
<link rel='self' href='https://git.amelek.net/vyos/vyos-cloud-init.git/atom?h=crux'/>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/vyos-cloud-init.git/'/>
<updated>2018-12-03T22:07:59+00:00</updated>
<entry>
<title>dhclient-hook: cleanups, tests and fix a bug on 'down' event.</title>
<updated>2018-12-03T22:07:59+00:00</updated>
<author>
<name>Scott Moser</name>
<email>smoser@ubuntu.com</email>
</author>
<published>2018-12-03T22:07:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/vyos-cloud-init.git/commit/?id=230e67ebd489c0d895243a2fc66ca95af2cea13b'/>
<id>urn:sha1:230e67ebd489c0d895243a2fc66ca95af2cea13b</id>
<content type='text'>
I noticed a bug in dhclient_hook on the 'down' event, using 'is'
operator rather than '==' (if self.net_action is 'down').

This refactors/simplifies the code a bit for easier testing and adds
tests.  The reason for the rename of 'action' to 'event' is to just
be internally consistent.  The word and Namespace 'action' is used
by cloud-init main, so it was not really usable here.

Also adds a main which can easily be debugged with:
  CI_DHCP_HOOK_DATA_D=./my.d python -m cloudinit.dhclient_hook up eth0
</content>
</entry>
<entry>
<title>azure: retry imds polling on requests.Timeout</title>
<updated>2018-11-13T03:14:58+00:00</updated>
<author>
<name>Chad Smith</name>
<email>chad.smith@canonical.com</email>
</author>
<published>2018-11-13T03:14:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/vyos-cloud-init.git/commit/?id=6062595b83e08e0f12e1fe6d8e367d8db9d91ef8'/>
<id>urn:sha1:6062595b83e08e0f12e1fe6d8e367d8db9d91ef8</id>
<content type='text'>
There is an infrequent race when the booting instance can hit the IMDS
service before it is fully available. This results in a
requests.ConnectTimeout being raised.
Azure's retry_callback logic now retries on either 404s or Timeouts.

LP:1800223
</content>
</entry>
<entry>
<title>update detection of openSUSE variants</title>
<updated>2018-10-22T19:31:51+00:00</updated>
<author>
<name>Robert Schweikert</name>
<email>rjschwei@suse.com</email>
</author>
<published>2018-10-22T19:31:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/vyos-cloud-init.git/commit/?id=4ea64f153c87a786642abfa4db4b31c4bdd5bc9d'/>
<id>urn:sha1:4ea64f153c87a786642abfa4db4b31c4bdd5bc9d</id>
<content type='text'>
openSUSE has changed the way the distribution is identified in
os-release.  Add support detecting for openSUSE Leap 42.3, Leap 15
and  TumbleWeed.

Reference: boo#1111427
</content>
</entry>
<entry>
<title>instance-data: Add standard keys platform and subplatform. Refactor ec2.</title>
<updated>2018-10-09T21:46:35+00:00</updated>
<author>
<name>Chad Smith</name>
<email>chad.smith@canonical.com</email>
</author>
<published>2018-10-09T21:46:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/vyos-cloud-init.git/commit/?id=f0bc02d7e221c9aa5982b267739481420c761ead'/>
<id>urn:sha1:f0bc02d7e221c9aa5982b267739481420c761ead</id>
<content type='text'>
Add the following instance-data.json standardized keys:
* v1._beta_keys: List any v1 keys in beta development,
  e.g. ['subplatform'].
* v1.public_ssh_keys: List of any cloud-provided ssh keys for the
  instance.
* v1.platform: String representing the cloud platform api supporting the
  datasource. For example: 'ec2' for aws, aliyun and brightbox cloud
  names.
* v1.subplatform: String with more details about the source of the
  metadata consumed. For example, metadata uri, config drive device path
  or seed directory.

To support the new platform and subplatform standardized instance-data,
DataSource and its subclasses grew platform and subplatform attributes.
The platform attribute defaults to the lowercase string datasource name at
self.dsname. This method is overridden in NoCloud, Ec2 and ConfigDrive
datasources.

The subplatform attribute calls a _get_subplatform method which will
return a string containing a simple slug for subplatform type such as
metadata, seed-dir or config-drive followed by a detailed uri, device or
directory path where the datasource consumed its configuration.

As part of this work, DatasourceEC2 methods _get_data and _crawl_metadata
have been refactored for a few reasons:
- crawl_metadata is now a read-only operation, persisting no attributes on
  the datasource instance and returns a dictionary of consumed metadata.
- crawl_metadata now closely represents the raw stucture of the ec2
  metadata consumed, so that end-users can leverage public ec2 metadata
  documentation where possible.
- crawl_metadata adds a '_metadata_api_version' key to the crawled
  ds.metadata to advertise what version of EC2's api was consumed by
  cloud-init.
- _get_data now does all the processing of crawl_metadata and saves
  datasource instance attributes userdata_raw, metadata etc.

Additional drive-bys:
* unit test rework for test_altcloud and test_azure to simplify mocks
  and make use of existing util and test_helpers functions.
</content>
</entry>
<entry>
<title>user-data: jinja template to render instance-data.json in cloud-config</title>
<updated>2018-09-11T17:31:46+00:00</updated>
<author>
<name>Chad Smith</name>
<email>chad.smith@canonical.com</email>
</author>
<published>2018-09-11T17:31:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/vyos-cloud-init.git/commit/?id=c7555762f3a30190ce7726b4d013bc3e83c7e4b6'/>
<id>urn:sha1:c7555762f3a30190ce7726b4d013bc3e83c7e4b6</id>
<content type='text'>
Allow users to provide '## template: jinja' as the first line or their
#cloud-config or custom script user-data parts. When this header exists,
the cloud-config or script will be rendered as a jinja template.

All instance metadata keys and values present in
/run/cloud-init/instance-data.json will be available as jinja variables
for the template. This means any cloud-config module or script can
reference any standardized instance data in templates and scripts.

Additionally, any standardized instance-data.json keys scoped below a
'&lt;v#&gt;' key will be promoted as a top-level key for ease of reference in
templates. This means that '{{ local_hostname }}' is the same as using the
latest '{{ v#.local_hostname }}'.

Since instance-data is written to /run/cloud-init/instance-data.json, make
sure it is persisted across reboots when the cached datasource opject is
reloaded.

LP: #1791781
</content>
</entry>
<entry>
<title>tests: print failed testname instead of docstring upon failure</title>
<updated>2018-09-05T17:31:23+00:00</updated>
<author>
<name>Chad Smith</name>
<email>chad.smith@canonical.com</email>
</author>
<published>2018-09-05T17:31:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/vyos-cloud-init.git/commit/?id=d47d404e557333e29cdb07fd4c1ce2d90c403110'/>
<id>urn:sha1:d47d404e557333e29cdb07fd4c1ce2d90c403110</id>
<content type='text'>
</content>
</entry>
<entry>
<title>tests: Disallow use of util.subp except for where needed.</title>
<updated>2018-09-05T16:02:25+00:00</updated>
<author>
<name>Scott Moser</name>
<email>smoser@ubuntu.com</email>
</author>
<published>2018-09-05T16:02:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/vyos-cloud-init.git/commit/?id=a8dcad9ac62bb1d2a4f7489960395bad6cac9382'/>
<id>urn:sha1:a8dcad9ac62bb1d2a4f7489960395bad6cac9382</id>
<content type='text'>
In many cases, cloud-init uses 'util.subp' to run a subprocess.
This is not really desirable in our unit tests as it makes the tests
dependent upon existance of those utilities.

The change here is to modify the base test case class (CiTestCase) to
raise exception any time subp is called.  Then, fix all callers.
For cases where subp is necessary or actually desired, we can use it
via
  a.) context hander CiTestCase.allow_subp(value)
  b.) class level self.allowed_subp = value

Both cases the value is a list of acceptable executable names that
will be called (essentially argv[0]).

Some cleanups in AltCloud were done as the code was being updated.
</content>
</entry>
<entry>
<title>sysconfig: refactor sysconfig to accept distro specific templates paths</title>
<updated>2018-09-05T14:17:16+00:00</updated>
<author>
<name>Ryan Harper</name>
<email>ryan.harper@canonical.com</email>
</author>
<published>2018-09-05T14:17:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/vyos-cloud-init.git/commit/?id=db50bc0d999e3a90136864a774f85e4e15b144e8'/>
<id>urn:sha1:db50bc0d999e3a90136864a774f85e4e15b144e8</id>
<content type='text'>
Multiple distros use sysconfig format but have different content
and paths to certain files.  Update distros to specify these
template paths in their renderer_configs dictionary.
</content>
</entry>
<entry>
<title>Add unit tests for config/cc_ssh.py</title>
<updated>2018-09-01T17:59:18+00:00</updated>
<author>
<name>Francis Ginther</name>
<email>francis.ginther@canonical.com</email>
</author>
<published>2018-09-01T17:59:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/vyos-cloud-init.git/commit/?id=3f6d0972d83c8bfd6a5e666d73cb84a8cfe9c8b6'/>
<id>urn:sha1:3f6d0972d83c8bfd6a5e666d73cb84a8cfe9c8b6</id>
<content type='text'>
These tests focus on the apply_credentials method and the ssh setup for
root and a distro default user.
</content>
</entry>
<entry>
<title>Fix the built-in cloudinit/tests/helpers:skipIf</title>
<updated>2018-08-31T22:13:09+00:00</updated>
<author>
<name>Scott Moser</name>
<email>smoser@ubuntu.com</email>
</author>
<published>2018-08-31T22:13:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/vyos-cloud-init.git/commit/?id=2d0ca72cde42f72babbce5823ea3bbf30a61021c'/>
<id>urn:sha1:2d0ca72cde42f72babbce5823ea3bbf30a61021c</id>
<content type='text'>
this version uses unittest2 skipIf which is present in our python 2.6
environment.
</content>
</entry>
</feed>
