diff options
author | Scott Moser <smoser@ubuntu.com> | 2014-10-29 19:36:57 -0400 |
---|---|---|
committer | Scott Moser <smoser@ubuntu.com> | 2014-10-29 19:36:57 -0400 |
commit | 9eed0fef5030e2e66f4bc1e549783638087786f4 (patch) | |
tree | 2fde82594c6e3932ed5c1bb57ea9297ee1f5655d /cloudinit/config/cc_ubuntu_init_switch.py | |
parent | c634d32173fb09ff33896f3b03e495fada80dd33 (diff) | |
parent | 24e6ef998899418d73a63a64141fbaa209320967 (diff) | |
download | vyos-cloud-init-9eed0fef5030e2e66f4bc1e549783638087786f4.tar.gz vyos-cloud-init-9eed0fef5030e2e66f4bc1e549783638087786f4.zip |
Start adding cloud config module docs.
Add the basics of docs that can be extracted from the code itself (also
impose a initial format that will be useful for further modules to
follow). In this initial addition modify the cc_debug.py and
cc_ubuntu_init_switch.py to use this new style.
LP: #1383510
Diffstat (limited to 'cloudinit/config/cc_ubuntu_init_switch.py')
-rw-r--r-- | cloudinit/config/cc_ubuntu_init_switch.py | 30 |
1 files changed, 14 insertions, 16 deletions
diff --git a/cloudinit/config/cc_ubuntu_init_switch.py b/cloudinit/config/cc_ubuntu_init_switch.py index 6f994bff..7e88ed85 100644 --- a/cloudinit/config/cc_ubuntu_init_switch.py +++ b/cloudinit/config/cc_ubuntu_init_switch.py @@ -17,30 +17,27 @@ # along with this program. If not, see <http://www.gnu.org/licenses/>. """ -ubuntu_init_switch: reboot system into another init +**Summary:** reboot system into another init. -This provides a way for the user to boot with systemd even if the -image is set to boot with upstart. It should be run as one of the first -cloud_init_modules, and will switch the init system and then issue a reboot. -The next boot will come up in the target init system and no action will +**Description:** This module provides a way for the user to boot with systemd +even if the image is set to boot with upstart. It should be run as one of the +first ``cloud_init_modules``, and will switch the init system and then issue a +reboot. The next boot will come up in the target init system and no action will be taken. This should be inert on non-ubuntu systems, and also exit quickly. -config is comes under the top level 'init_switch' dictionary. +It can be configured with the following option structure:: -#cloud-config -init_switch: - target: systemd - reboot: true + init_switch: + target: systemd (can be 'systemd' or 'upstart') + reboot: true (reboot if a change was made, or false to not reboot) -'target' can be 'systemd' or 'upstart'. Best effort is made, but its possible -this system will break, and probably won't interact well with any other -mechanism you've used to switch the init system. +.. note:: -'reboot': [default=true]. - true: reboot if a change was made. - false: do not reboot. + Best effort is made, but it's possible + this system will break, and probably won't interact well with any other + mechanism you've used to switch the init system. """ from cloudinit.settings import PER_INSTANCE @@ -91,6 +88,7 @@ fi def handle(name, cfg, cloud, log, args): + """Handler method activated by cloud-init.""" if not isinstance(cloud.distro, ubuntu.Distro): log.debug("%s: distro is '%s', not ubuntu. returning", |