← Back to team overview

cloud-init-dev team mailing list archive

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

 

Ryan Harper has proposed merging ~raharper/cloud-init:update-features-doc into cloud-init:master.

Requested reviews:
  cloud-init commiters (cloud-init-dev)

For more details, see:
https://code.launchpad.net/~raharper/cloud-init/+git/cloud-init/+merge/328992

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.
-- 
Your team cloud-init commiters is requested to review the proposed merge of ~raharper/cloud-init:update-features-doc into cloud-init:master.
diff --git a/doc/rtd/topics/capabilities.rst b/doc/rtd/topics/capabilities.rst
index 2c8770b..b8034b0 100644
--- a/doc/rtd/topics/capabilities.rst
+++ b/doc/rtd/topics/capabilities.rst
@@ -31,19 +31,49 @@ support. This allows other applications to detect what features the installed
 cloud-init supports without having to parse its version number. If present,
 this list of features will be located at ``cloudinit.version.FEATURES``.
 
-When checking if cloud-init supports a feature, in order to not break the
-detection script on older versions of cloud-init without the features list, a
-script similar to the following should be used. Note that this will exit 0 if
-the feature is supported and 1 otherwise::
+Currently defined feature names include:
 
-    import sys
-    from cloudinit import version
-    sys.exit('<FEATURE_NAME>' not in getattr(version, 'FEATURES', []))
+ - ``NETWORK_CONFIG_V1`` support for v1 networking configuration,
+   see :ref:`network_config_v1` documentation for examples.
+ - ``NETWORK_CONFIG_V2`` support for v2 networking configuration,
+   see :ref:`network_config_v2` documentation for examples.
 
-Currently defined feature names include:
 
- - ``NETWORK_CONFIG_V1`` support for v1 networking configuration, see curtin
-   documentation for examples.
+CLI Interface :
+
+``cloud-init features`` will print out each feature supported.  If cloud-init
+does not have the features subcommand, it also does not support any features
+described in this document.
+
+.. code-block:: bash
+
+  % cloud-init --help
+  usage: cloud-init [-h] [--version] [--file FILES] [--debug] [--force]
+                    {init,modules,query,single,dhclient-hook,features} ...
+
+  positional arguments:
+    {init,modules,query,single,dhclient-hook,features}
+      init                initializes cloud-init and performs initial modules
+      modules             activates modules using a given configuration key
+      query               query information stored in cloud-init
+      single              run a single module
+      dhclient-hook       run the dhclient hookto record network info
+      features            list defined features
+
+  optional arguments:
+    -h, --help            show this help message and exit
+    --version, -v         show program's version number and exit
+    --file FILES, -f FILES
+                          additional yaml configuration files to use
+    --debug, -d           show additional pre-action logging (default: False)
+    --force               force running even if no datasource is found (use at
+                          your own risk)
+
+
+  % cloud-init features
+  NETWORK_CONFIG_V1
+  NETWORK_CONFIG_V2
+
 
 .. _Cloud-init: https://launchpad.net/cloud-init
 .. vi: textwidth=78

Follow ups