Skip to content

Commit

Permalink
doc(nocloud): Document network-config file (#5204)
Browse files Browse the repository at this point in the history
Also standardize spelling on "command line".
  • Loading branch information
holmanb authored May 29, 2024
1 parent 2856f4c commit fa1b868
Show file tree
Hide file tree
Showing 33 changed files with 144 additions and 99 deletions.
2 changes: 1 addition & 1 deletion cloudinit/cmd/clean.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#
# This file is part of cloud-init. See LICENSE file for license information.

"""Define 'clean' utility and handler as part of cloud-init commandline."""
"""Define 'clean' utility and handler as part of cloud-init command line."""

import argparse
import glob
Expand Down
2 changes: 1 addition & 1 deletion cloudinit/cmd/devel/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This file is part of cloud-init. See LICENSE file for license information.

"""Common cloud-init devel commandline utility functions."""
"""Common cloud-init devel command line utility functions."""

from cloudinit.helpers import Paths
from cloudinit.stages import Init
Expand Down
2 changes: 1 addition & 1 deletion cloudinit/cmd/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ def handle_args(name, args):
try:
rendered_payload = render_jinja_payload(
payload=payload,
payload_fn="query commandline",
payload_fn="query command line",
instance_data=instance_data,
debug=True if args.debug else False,
)
Expand Down
6 changes: 3 additions & 3 deletions cloudinit/cmd/status.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#
# This file is part of cloud-init. See LICENSE file for license information.

"""Define 'status' utility and handler as part of cloud-init commandline."""
"""Define 'status' utility and handler as part of cloud-init command line."""

import argparse
import enum
Expand Down Expand Up @@ -48,11 +48,11 @@ class EnabledStatus(enum.Enum):
"""Enum representing user-visible cloud-init boot status codes."""

DISABLED_BY_GENERATOR = "disabled-by-generator"
DISABLED_BY_KERNEL_CMDLINE = "disabled-by-kernel-cmdline"
DISABLED_BY_KERNEL_CMDLINE = "disabled-by-kernel-command-line"
DISABLED_BY_MARKER_FILE = "disabled-by-marker-file"
DISABLED_BY_ENV_VARIABLE = "disabled-by-environment-variable"
ENABLED_BY_GENERATOR = "enabled-by-generator"
ENABLED_BY_KERNEL_CMDLINE = "enabled-by-kernel-cmdline"
ENABLED_BY_KERNEL_CMDLINE = "enabled-by-kernel-command-line"
ENABLED_BY_SYSVINIT = "enabled-by-sysvinit"
UNKNOWN = "unknown"

Expand Down
2 changes: 1 addition & 1 deletion cloudinit/config/cc_resizefs.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ def maybe_get_writable_device_path(devpath, info):
@param info: String representing information about the requested device.
@param log: Logger to which logs will be added upon error.
@returns devpath or updated devpath per kernel commandline if the device
@returns devpath or updated devpath per kernel command line if the device
path is a writable block device, returns None otherwise.
"""
container = util.is_container()
Expand Down
2 changes: 1 addition & 1 deletion cloudinit/config/cc_ubuntu_pro.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ def set_pro_config(pro_config: Any = None):


def configure_pro(token, enable=None):
"""Call ua commandline client to attach and/or enable services."""
"""Call ua command line client to attach and/or enable services."""
if enable is None:
enable = []
elif isinstance(enable, str):
Expand Down
2 changes: 1 addition & 1 deletion cloudinit/config/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -1735,7 +1735,7 @@ def get_config_paths_from_args(
) -> Tuple[str, List[InstanceDataPart]]:
"""Return appropriate instance-data.json and instance data parts
Based on commandline args, and user permissions, determine the
Based on command line args, and user permissions, determine the
appropriate instance-data.json to source for jinja templates and
a list of applicable InstanceDataParts such as user-data, vendor-data
and network-config for which to validate schema. Avoid returning any
Expand Down
2 changes: 1 addition & 1 deletion cloudinit/net/cmdline.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ def _b64dgz(data):
blob = base64.b64decode(data)
except (TypeError, ValueError):
LOG.error(
"Expected base64 encoded kernel commandline parameter"
"Expected base64 encoded kernel command line parameter"
" network-config. Ignoring network-config=%s.",
data,
)
Expand Down
4 changes: 2 additions & 2 deletions cloudinit/sources/DataSourceNoCloud.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def _get_data(self):

try:
# Parse the system serial label from dmi. If not empty, try parsing
# like the commandline
# like the command line
md = {}
serial = dmi.read_dmi_data("system-serial-number")
if serial and load_cmdline_data(md, serial):
Expand Down Expand Up @@ -375,7 +375,7 @@ def __init__(self, sys_cfg, distro, paths):
)

def ds_detect(self):
"""Check dmi and kernel commandline for dsname
"""Check dmi and kernel command line for dsname
NoCloud historically used "nocloud-net" as its dsname
for network timeframe (DEP_NETWORK), which supports http(s) urls.
Expand Down
6 changes: 3 additions & 3 deletions cloudinit/sources/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -386,15 +386,15 @@ def ds_detect(self) -> bool:
def override_ds_detect(self) -> bool:
"""Override if either:
- only a single datasource defined (nothing to fall back to)
- commandline argument is used (ci.ds=OpenStack)
- command line argument is used (ci.ds=OpenStack)
Note: get_cmdline() is required for the general case - when ds-identify
does not run, _something_ needs to detect the kernel command line
definition.
"""
if self.dsname.lower() == parse_cmdline().lower():
LOG.debug(
"Machine is configured by the kernel commandline to run on "
"Machine is configured by the kernel command line to run on "
"single datasource %s.",
self,
)
Expand Down Expand Up @@ -1232,7 +1232,7 @@ def parse_cmdline_or_dmi(input: str) -> str:
dsname = deprecated.group(1).strip()
util.deprecate(
deprecated=(
f"Defining the datasource on the commandline using "
f"Defining the datasource on the command line using "
f"ci.ds={dsname} or "
f"ci.datasource={dsname}"
),
Expand Down
File renamed without changes.
3 changes: 2 additions & 1 deletion doc/rtd/explanation/format.rst
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ Kernel command line

When using the NoCloud datasource, users can pass user data via the kernel
command line parameters. See the :ref:`NoCloud datasource<datasource_nocloud>`
and :ref:`kernel_cmdline` documentation for more details.
and :ref:`explanation/kernel-command-line:Kernel command line` documentation
for more details.

Gzip compressed content
=======================
Expand Down
2 changes: 1 addition & 1 deletion doc/rtd/explanation/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ knowledge and become better at using and configuring ``cloud-init``.
vendordata.rst
security.rst
analyze.rst
kernel-cmdline.rst
kernel-command-line.rst
failure_states.rst
exported_errors.rst
return_codes.rst
2 changes: 1 addition & 1 deletion doc/rtd/explanation/instancedata.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Instance metadata
:maxdepth: 1
:hidden:

kernel-cmdline.rst
kernel-command-line.rst

What is ``instance-data?``
==========================
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
.. _kernel_cmdline:

Kernel command line
*******************

Expand Down
6 changes: 3 additions & 3 deletions doc/rtd/howto/disable_cloud_init.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ Example:
$ touch /etc/cloud/cloud-init.disabled
Method 2: kernel commandline
============================
Method 2: kernel command line
=============================

To disable cloud-init, add ``cloud-init=disabled`` to the kernel commandline.
To disable cloud-init, add ``cloud-init=disabled`` to the kernel command line.

Example (using GRUB2 with Ubuntu):

Expand Down
4 changes: 2 additions & 2 deletions doc/rtd/howto/status.rst
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,11 @@ contain any of the following states:
which prevents cloud-init from ever running
- ``'disabled-by-generator'``: ``ds-identify`` determined no applicable
cloud-init datasources
- ``'disabled-by-kernel-cmdline'``: kernel command line contained
- ``'disabled-by-kernel-command-line'``: kernel command line contained
cloud-init=disabled
- ``'disabled-by-environment-variable'``: environment variable
``KERNEL_CMDLINE`` contained ``cloud-init=disabled``
- ``'enabled-by-kernel-cmdline'``: kernel command line contained
- ``'enabled-by-kernel-command-line'``: kernel command line contained
cloud-init=enabled
- ``'enabled-by-generator'``: ``ds-identify`` detected possible cloud-init
datasources
Expand Down
8 changes: 4 additions & 4 deletions doc/rtd/reference/breaking_changes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -83,16 +83,16 @@ which will be returned when cloud-init experiences an error that it can
recover from. See :ref:`this page which documents the change <error_codes>`.


23.2 - kernel commandline
=========================
23.2 - kernel command line
==========================

The ``ds=`` kernel commandline value is used to forcibly select a specific
The ``ds=`` kernel command line value is used to forcibly select a specific
datasource in cloud-init. Prior to 23.2, this only optionally selected
the ``NoCloud`` datasource.

Anyone that previously had a matching ``ds=nocloud*`` in their kernel command
line that did not want to use the ``NoCloud`` datasource may experience broken
behavior as a result of this change.

Workarounds include updating the kernel commandline and optionally configuring
Workarounds include updating the kernel command line and optionally configuring
a ``datasource_list`` in ``/etc/cloud/cloud.cfg.d/*.cfg``.
2 changes: 1 addition & 1 deletion doc/rtd/reference/cli.rst
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ Example output:

Generally run by OS init systems to execute ``cloud-init``'s stages:
*init* and *init-local*. See :ref:`boot_stages` for more info.
Can be run on the commandline, but is generally gated to run only once
Can be run on the command line, but is generally gated to run only once
due to semaphores in :file:`/var/lib/cloud/instance/sem/` and
:file:`/var/lib/cloud/sem`.

Expand Down
2 changes: 1 addition & 1 deletion doc/rtd/reference/datasource_dsname_map.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Datasource dsname
*****************

Each datasource has an attribute called dsname. This may be used in the
kernel commandline to
kernel command line to
:ref:`override datasource detection<kernel_datasource_override>`. The
``dsname`` on the kernel command line may be a case-insensitive match. See the
mapping between datasource module names and ``dsname`` in the table below.
Expand Down
2 changes: 1 addition & 1 deletion doc/rtd/reference/datasources.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ There are exceptions, however, when the :ref:`datasource does not
identify<datasource_ironic>` itself to ``cloud-init``. For these
exceptions, one can override datasource detection either by configuring a
single datasource in the :ref:`datasource_list<base_config_datasource_list>`,
or by using :ref:`kernel commandline arguments<kernel_datasource_override>`.
or by using :ref:`kernel command line arguments<kernel_datasource_override>`.

.. _datasources_supported:

Expand Down
Loading

0 comments on commit fa1b868

Please sign in to comment.