Merge ~raharper/cloud-init:update-features-doc into cloud-init:master

Proposed by Ryan Harper on 2017-08-14
Status: Merged
Merged at revision: 385d1cae1023ed89c3830a148aea02807240a07d
Proposed branch: ~raharper/cloud-init:update-features-doc
Merge into: cloud-init:master
Diff against target: 64 lines (+40/-10)
1 file modified
doc/rtd/topics/capabilities.rst (+40/-10)
Reviewer Review Type Date Requested Status
Chad Smith 2017-08-14 Approve on 2017-08-14
Server Team CI bot continuous-integration Approve on 2017-08-14
Review via email: mp+328992@code.launchpad.net

Description of the Change

doc:capabilities Update supported features, add reference and cli subcommand

cloud-init has two features, network_config_v1 and network_config_v2, update the
list of features in the documentation and include reference link to the format
of the features. Replace the 'how to check' information with an example of
the cloud-init features subcommand.

To post a comment you must log in.

PASSED: Continuous integration, rev:4176908a6b2a7fc1ef71f9ac99ac58cfe49d43c6
https://jenkins.ubuntu.com/server/job/cloud-init-ci/137/
Executed test runs:
    SUCCESS: Checkout
    SUCCESS: Unit & Style Tests
    SUCCESS: Ubuntu LTS: Build
    SUCCESS: Ubuntu LTS: Integration
    SUCCESS: CentOS 6 & 7: Build & Test
    IN_PROGRESS: Declarative: Post Actions

Click here to trigger a rebuild:
https://jenkins.ubuntu.com/server/job/cloud-init-ci/137/rebuild

review: Approve (continuous-integration)
Chad Smith (chad.smith) wrote :

+1 minor inline note.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/doc/rtd/topics/capabilities.rst b/doc/rtd/topics/capabilities.rst
2index 2c8770b..b8034b0 100644
3--- a/doc/rtd/topics/capabilities.rst
4+++ b/doc/rtd/topics/capabilities.rst
5@@ -31,19 +31,49 @@ support. This allows other applications to detect what features the installed
6 cloud-init supports without having to parse its version number. If present,
7 this list of features will be located at ``cloudinit.version.FEATURES``.
8
9-When checking if cloud-init supports a feature, in order to not break the
10-detection script on older versions of cloud-init without the features list, a
11-script similar to the following should be used. Note that this will exit 0 if
12-the feature is supported and 1 otherwise::
13+Currently defined feature names include:
14
15- import sys
16- from cloudinit import version
17- sys.exit('<FEATURE_NAME>' not in getattr(version, 'FEATURES', []))
18+ - ``NETWORK_CONFIG_V1`` support for v1 networking configuration,
19+ see :ref:`network_config_v1` documentation for examples.
20+ - ``NETWORK_CONFIG_V2`` support for v2 networking configuration,
21+ see :ref:`network_config_v2` documentation for examples.
22
23-Currently defined feature names include:
24
25- - ``NETWORK_CONFIG_V1`` support for v1 networking configuration, see curtin
26- documentation for examples.
27+CLI Interface :
28+
29+``cloud-init features`` will print out each feature supported. If cloud-init
30+does not have the features subcommand, it also does not support any features
31+described in this document.
32+
33+.. code-block:: bash
34+
35+ % cloud-init --help
36+ usage: cloud-init [-h] [--version] [--file FILES] [--debug] [--force]
37+ {init,modules,query,single,dhclient-hook,features} ...
38+
39+ positional arguments:
40+ {init,modules,query,single,dhclient-hook,features}
41+ init initializes cloud-init and performs initial modules
42+ modules activates modules using a given configuration key
43+ query query information stored in cloud-init
44+ single run a single module
45+ dhclient-hook run the dhclient hookto record network info
46+ features list defined features
47+
48+ optional arguments:
49+ -h, --help show this help message and exit
50+ --version, -v show program's version number and exit
51+ --file FILES, -f FILES
52+ additional yaml configuration files to use
53+ --debug, -d show additional pre-action logging (default: False)
54+ --force force running even if no datasource is found (use at
55+ your own risk)
56+
57+
58+ % cloud-init features
59+ NETWORK_CONFIG_V1
60+ NETWORK_CONFIG_V2
61+
62
63 .. _Cloud-init: https://launchpad.net/cloud-init
64 .. vi: textwidth=78

Subscribers

People subscribed via source and target branches