<feed xmlns='http://www.w3.org/2005/Atom'>
<title>vyos-cloud-init.git/cloudinit/cmd/main.py, branch rolling</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=rolling</id>
<link rel='self' href='https://git.amelek.net/vyos/vyos-cloud-init.git/atom?h=rolling'/>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/vyos-cloud-init.git/'/>
<updated>2022-01-18T17:05:29+00:00</updated>
<entry>
<title>Single JSON schema validation in early boot (#1175)</title>
<updated>2022-01-18T17:05:29+00:00</updated>
<author>
<name>Chad Smith</name>
<email>chad.smith@canonical.com</email>
</author>
<published>2022-01-18T17:05:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/vyos-cloud-init.git/commit/?id=4ba6fd283674df1ef25300d91c6d2061910744be'/>
<id>urn:sha1:4ba6fd283674df1ef25300d91c6d2061910744be</id>
<content type='text'>
Package a single JSON schema file for user-data validation at
cloudinit/config/cloud-init-schema.json.

Perform validate_cloudconfig_schema call to just after the
user-data is consumed. This will allow single validation of all
user-data against the full schema instead of
repetitive validatation calls against each cloud-config module
(cloudinit.config.cc_*) sub-schemas.

This branch defines the simple apt_pipelining schema and
migrates existing cc_apk_configure into cloud-init-schema.json.

The expectation will be additional branches to migrate from legacy
"schema" attributes inside each cloud-config module toward unique
cc_&lt;module_name&gt; definitions in the global shema file under "$defs"
of cloud-init-schema-X.Y..json.

Before legacy sub-schema definitions are migrated the following
funcs grew support to read sub-schemas from both static
cloud-init-schema.json and the individual cloud-config module
"schema" attributes:

- get_schema: source base schema file from cloud-init-schema.json
  and supplement with all legacy cloud-config module "schema" defs
- get_meta_doc: optional schema param so cloud-config modules
  no longer provide the own local sub-schemas
- _get_property_doc: render only documentation of sub-schema based
  on meta['id'] provided
- validate_cloudconfig_schema: allow optional schema param


Additionally, fix two minor bugs in _schemapath_for_cloudconfig:
- `cloud-init devel schema --annotate` which results in a Traceback
  if two keys at the same indent level have invalid types.
- exit early on empty cloud-config to avoid a Traceback on the CLI</content>
</entry>
<entry>
<title>Adopt Black and isort (SC-700) (#1157)</title>
<updated>2021-12-16T02:16:38+00:00</updated>
<author>
<name>James Falcon</name>
<email>james.falcon@canonical.com</email>
</author>
<published>2021-12-16T02:16:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/vyos-cloud-init.git/commit/?id=bae9b11da9ed7dd0b16fe5adeaf4774b7cc628cf'/>
<id>urn:sha1:bae9b11da9ed7dd0b16fe5adeaf4774b7cc628cf</id>
<content type='text'>
Applied Black and isort, fixed any linting issues, updated tox.ini
and CI.
</content>
</entry>
<entry>
<title>Allow disabling of network activation (SC-307) (#1048)</title>
<updated>2021-10-07T16:27:36+00:00</updated>
<author>
<name>James Falcon</name>
<email>james.falcon@canonical.com</email>
</author>
<published>2021-10-07T16:27:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/vyos-cloud-init.git/commit/?id=9c147e8341e287366790e60658f646cdcc59bef2'/>
<id>urn:sha1:9c147e8341e287366790e60658f646cdcc59bef2</id>
<content type='text'>
In #919 (81299de), we refactored some of the code used to bring up
networks across distros. Previously, the call to bring up network
interfaces during 'init' stage unintentionally resulted in a no-op
such that network interfaces were NEVER brought up by cloud-init, even
if new network interfaces were found after crawling the metadata.

The code was altered to bring up these discovered network interfaces.
On ubuntu, this results in a 'netplan apply' call during 'init' stage
for any ubuntu-based distro on a datasource that has a NETWORK
dependency. On GCE, this additional 'netplan apply' conflicts with the
google-guest-agent service, resulting in an instance that can no
be connected to.

This commit adds a 'disable_network_activation' option that can be
enabled in /etc/cloud.cfg to disable the activation of network
interfaces in 'init' stage.

LP: #1938299</content>
</entry>
<entry>
<title>Update pylint to v2.9.3 and fix the new issues it spots (#946)</title>
<updated>2021-07-20T14:58:21+00:00</updated>
<author>
<name>Paride Legovini</name>
<email>paride.legovini@canonical.com</email>
</author>
<published>2021-07-20T14:58:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/vyos-cloud-init.git/commit/?id=ec6afadbf0f0f77d5b58dccd70df77da89c2c91d'/>
<id>urn:sha1:ec6afadbf0f0f77d5b58dccd70df77da89c2c91d</id>
<content type='text'>
In CI run against pylint 2.9.3 and fix occurrences of:
 - W0237 (arguments-renamed)
 - W0402 (deprecated-module)

The W0402 deprecated-module was about module `imp`:

    cloudinit/patcher.py:9: [W0402(deprecated-module), ]
        Uses of a deprecated module 'imp'

The imp module is deprecated and replaced by importlib, which according
to the documentation has no replacement for acquire_lock() and
release_lock(), which are the only reason why `imp` is imported.
    
Nothing about the code using this lock that actually requires it.
Let's remove the locking code and the import altogether.

Dropping the locking makes patcher.patch() an empty wrapper around
_patch_logging(). Rename _patch_logging() to patch_logging() and
call it directly instead. Drop patch().</content>
</entry>
<entry>
<title>- Detect a Python version change and clear the cache (#857)</title>
<updated>2021-07-01T16:35:40+00:00</updated>
<author>
<name>Robert Schweikert</name>
<email>rjschwei@suse.com</email>
</author>
<published>2021-07-01T16:35:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/vyos-cloud-init.git/commit/?id=78e89b03ecb29e7df3181b1219a0b5f44b9d7532'/>
<id>urn:sha1:78e89b03ecb29e7df3181b1219a0b5f44b9d7532</id>
<content type='text'>
summary: Clear cache when a Python version change is detected

When a distribution gets updated it is possible that the Python version
changes. Python makes no guarantee that pickle is consistent across
versions as such we need to purge the cache and start over.

Co-authored-by: James Falcon &lt;therealfalcon@gmail.com&gt;</content>
</entry>
<entry>
<title>Drop unnecessary shebang from cmd/main.py (#722)</title>
<updated>2020-12-10T18:10:43+00:00</updated>
<author>
<name>Eduardo Otubo</name>
<email>otubo@redhat.com</email>
</author>
<published>2020-12-10T18:10:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/vyos-cloud-init.git/commit/?id=212b291dc0f3108f562bbbadfa89ae355815c01d'/>
<id>urn:sha1:212b291dc0f3108f562bbbadfa89ae355815c01d</id>
<content type='text'>
Fedora build system's rpmlint is complaining that there is a file with a
shebang but no executable flag set. No need to have shebang on this
file, so drop it.

Signed-off-by: Eduardo Otubo &lt;otubo@redhat.com&gt;
Co-authored-by: Scott Moser &lt;smoser@brickies.net&gt;
</content>
</entry>
<entry>
<title>cmd:main.py: Fix missing 'modules-init' key in modes dict</title>
<updated>2019-04-09T14:54:23+00:00</updated>
<author>
<name>Antonio Romito</name>
<email>antonio.romito@manicom.io</email>
</author>
<published>2019-04-09T14:54:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/vyos-cloud-init.git/commit/?id=bdd9c0ac9bcd68ec1ac3b2038dad0ba3dbd83341'/>
<id>urn:sha1:bdd9c0ac9bcd68ec1ac3b2038dad0ba3dbd83341</id>
<content type='text'>
Cloud-init's main.py will fail when presented with a new
stage name 'modules-init' if upgrading an older cloud-init.
Fix this by initializing unknown stage names before accessing.

LP: #1815109
</content>
</entry>
<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>cli: add cloud-init query subcommand to query instance metadata</title>
<updated>2018-09-25T21:59:16+00:00</updated>
<author>
<name>Chad Smith</name>
<email>chad.smith@canonical.com</email>
</author>
<published>2018-09-25T21:59:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/vyos-cloud-init.git/commit/?id=fc4b966ba928b30b1c586407e752e0b51b1031e8'/>
<id>urn:sha1:fc4b966ba928b30b1c586407e752e0b51b1031e8</id>
<content type='text'>
Cloud-init caches any cloud metadata crawled during boot in the file
/run/cloud-init/instance-data.json. Cloud-init also standardizes some of
that metadata across all clouds. The command 'cloud-init query' surfaces a
simple CLI to query or format any cached instance metadata so that scripts
or end-users do not have to write tools to crawl metadata themselves.

Since 'cloud-init query' is runnable by non-root users, redact any
sensitive data from instance-data.json and provide a root-readable
unredacted instance-data-sensitive.json. Datasources can now define a
sensitive_metadata_keys tuple which will redact any matching keys
which could contain passwords or credentials from instance-data.json.

Also add the following standardized 'v1' instance-data.json keys:
  - user_data: The base64encoded user-data provided at instance launch
  - vendor_data: Any vendor_data provided to the instance at launch
  - underscore_delimited versions of existing hyphenated keys:
    instance_id, local_hostname, availability_zone, cloud_name
</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>
</feed>
