From 7e586f0d4f59a5051f8723e6bbdd06466d19729e Mon Sep 17 00:00:00 2001 From: Sean Bright Date: Fri, 18 Nov 2016 17:15:08 -0500 Subject: Doc: various documentation fixes Several various minor fixes for the readthedocs documentation. --- doc/examples/cloud-config-boot-cmds.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'doc/examples') diff --git a/doc/examples/cloud-config-boot-cmds.txt b/doc/examples/cloud-config-boot-cmds.txt index 5c05bef7..84e487a5 100644 --- a/doc/examples/cloud-config-boot-cmds.txt +++ b/doc/examples/cloud-config-boot-cmds.txt @@ -9,7 +9,7 @@ # boothook, but possibly with more friendly. # - bootcmd will run on every boot # - the INSTANCE_ID variable will be set to the current instance id. -# - you can use 'cloud-init-boot-per' command to help only run once +# - you can use 'cloud-init-per' command to help only run once bootcmd: - echo 192.168.1.130 us.archive.ubuntu.com >> /etc/hosts - [ cloud-init-per, once, mymkfs, mkfs, /dev/vdb ] -- cgit v1.2.3 From 166df605dc9864eb163007300db7a611feb309d6 Mon Sep 17 00:00:00 2001 From: Scott Moser Date: Fri, 2 Dec 2016 20:20:41 -0500 Subject: fix decoding of utf-8 chars in yaml test Python 3 would fail to load yaml from doc/examples/cloud-config-apt.txt when the LANG (specifically LC_CTYPE) was 'C'. The changes here do 2 things: a.) remove the non-ascii characters from the yaml file. b.) fix the validate-yaml.py program to decode using utf-8 specifically rather than using the inherited settings. This fixes it now for ascii and in the future also should non-ascii slip in. --- doc/examples/cloud-config-apt.txt | 4 ++-- tools/validate-yaml.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'doc/examples') diff --git a/doc/examples/cloud-config-apt.txt b/doc/examples/cloud-config-apt.txt index 1a0fc6f2..ff8206f6 100644 --- a/doc/examples/cloud-config-apt.txt +++ b/doc/examples/cloud-config-apt.txt @@ -70,7 +70,7 @@ apt: # modifications have been made. # Suites are even disabled if no other modification was made, # but not if is preserve_sources_list is active. - # There is a special alias “$RELEASE” as in the sources that will be replace + # There is a special alias "$RELEASE" as in the sources that will be replace # by the matching release. # # To ease configuration and improve readability the following common ubuntu @@ -84,7 +84,7 @@ apt: # There is no harm in specifying a suite to be disabled that is not found in # the source.list file (just a no-op then) # - # Note: Lines don’t get deleted, but disabled by being converted to a comment. + # Note: Lines don't get deleted, but disabled by being converted to a comment. # The following example disables all usual defaults except $RELEASE-security. # On top it disables a custom suite called "mysuite" disable_suites: [$RELEASE-updates, backports, $RELEASE, mysuite] diff --git a/tools/validate-yaml.py b/tools/validate-yaml.py index ed9037d9..2f28d230 100755 --- a/tools/validate-yaml.py +++ b/tools/validate-yaml.py @@ -12,8 +12,8 @@ if __name__ == "__main__": for fn in sys.argv[1:]: sys.stdout.write("%s" % (fn)) try: - fh = open(fn, 'r') - yaml.safe_load(fh.read()) + fh = open(fn, 'rb') + yaml.safe_load(fh.read().decode('utf-8')) fh.close() sys.stdout.write(" - ok\n") except Exception as e: -- cgit v1.2.3 From 39fb5a0240597112af8162c6c3365288450a7a77 Mon Sep 17 00:00:00 2001 From: Anhad Jai Singh Date: Fri, 9 Dec 2016 19:40:26 +0530 Subject: doc: change 'nobootwait' to 'nofail' in docs 'nobootwait' is an upstart specific extension to the mount syntax that is not supported by other mount systems. As Ubuntu 16.04 moved from upstart to systemd, support for 'nobootwait' was lost. All examples using 'nobootwait' are updated to use the standard 'nofail', which gives the expected behaviour of not failing to boot in case a volume is missing. There are subtle differences in semantics between 'nobootwait' and 'nofail', but it is the best substitute that gives behaviour similar to the upstart specific option. --- cloudinit/config/cc_mounts.py | 12 ++++++++++-- doc/examples/cloud-config-gluster.txt | 4 ++-- doc/examples/cloud-config-mount-points.txt | 8 ++++---- doc/examples/cloud-config.txt | 6 +++--- tests/data/merge_sources/expected8.yaml | 2 +- tests/data/merge_sources/source8-1.yaml | 2 +- 6 files changed, 21 insertions(+), 13 deletions(-) (limited to 'doc/examples') diff --git a/cloudinit/config/cc_mounts.py b/cloudinit/config/cc_mounts.py index 0c796b18..5cb2ca8a 100644 --- a/cloudinit/config/cc_mounts.py +++ b/cloudinit/config/cc_mounts.py @@ -42,6 +42,14 @@ values. It defaults to:: mount_default_fields: [none, none, "auto", "defaults,nobootwait", "0", "2"] +On a systemd booted system that default is the mostly equivalent:: + + mount_default_fields: [none, none, "auto", + "defaults,nofail,x-systemd.requires=cloud-init.service", "0", "2"] + +Note that `nobootwait` is an upstart specific boot option that somewhat +equates to the more standard `nofail`. + Swap files can be configured by setting the path to the swap file to create with ``filename``, the size of the swap file with ``size`` maximum size of the swap file if using an ``size: auto`` with ``maxsize``. By default no @@ -58,8 +66,8 @@ swap file is created. mounts: - [ /dev/ephemeral0, /mnt, auto, "defaults,noexec" ] - [ sdc, /opt/data ] - - [ xvdh, /opt/data, "auto", "defaults,nobootwait", "0", "0" ] - mount_default_fields: [None, None, "auto", "nefaults,nobootwait", "0", "2"] + - [ xvdh, /opt/data, "auto", "defaults,nofail", "0", "0" ] + mount_default_fields: [None, None, "auto", "defaults,nofail", "0", "2"] swap: filename: size: <"auto"/size in bytes> diff --git a/doc/examples/cloud-config-gluster.txt b/doc/examples/cloud-config-gluster.txt index f8183e77..cb979123 100644 --- a/doc/examples/cloud-config-gluster.txt +++ b/doc/examples/cloud-config-gluster.txt @@ -1,6 +1,6 @@ #cloud-config # vim: syntax=yaml -# Mounts volfile exported by glusterfsd running on +# Mounts volfile exported by glusterfsd running on # "volfile-server-hostname" onto the local mount point '/mnt/data' # # In reality, replace 'volfile-server-hostname' with one of your nodes @@ -10,7 +10,7 @@ packages: - glusterfs-client mounts: - - [ 'volfile-server-hostname:6996', /mnt/data, glusterfs, "defaults,nobootwait", "0", "2" ] + - [ 'volfile-server-hostname:6996', /mnt/data, glusterfs, "defaults,nofail", "0", "2" ] runcmd: - [ modprobe, fuse ] diff --git a/doc/examples/cloud-config-mount-points.txt b/doc/examples/cloud-config-mount-points.txt index aa676c24..5a6c24f5 100644 --- a/doc/examples/cloud-config-mount-points.txt +++ b/doc/examples/cloud-config-mount-points.txt @@ -23,19 +23,19 @@ # - if an entry does not have all 6 fields, they will be filled in # with values from 'mount_default_fields' below. # -# Note, that you should set 'nobootwait' (see man fstab) for volumes that may -# not be attached at instance boot (or reboot) +# Note, that you should set 'nofail' (see man fstab) for volumes that may not +# be attached at instance boot (or reboot). # mounts: - [ ephemeral0, /mnt, auto, "defaults,noexec" ] - [ sdc, /opt/data ] - - [ xvdh, /opt/data, "auto", "defaults,nobootwait", "0", "0" ] + - [ xvdh, /opt/data, "auto", "defaults,nofail", "0", "0" ] - [ dd, /dev/zero ] # mount_default_fields # These values are used to fill in any entries in 'mounts' that are not # complete. This must be an array, and must have 7 fields. -mount_default_fields: [ None, None, "auto", "defaults,nobootwait", "0", "2" ] +mount_default_fields: [ None, None, "auto", "defaults,nofail", "0", "2" ] # swap can also be set up by the 'mounts' module diff --git a/doc/examples/cloud-config.txt b/doc/examples/cloud-config.txt index 190029e4..c5f84b13 100644 --- a/doc/examples/cloud-config.txt +++ b/doc/examples/cloud-config.txt @@ -46,19 +46,19 @@ packages: # - if an entry does not have all 6 fields, they will be filled in # with values from 'mount_default_fields' below. # -# Note, that you should set 'nobootwait' (see man fstab) for volumes that may +# Note, that you should set 'nofail' (see man fstab) for volumes that may # not be attached at instance boot (or reboot) # mounts: - [ ephemeral0, /mnt, auto, "defaults,noexec" ] - [ sdc, /opt/data ] - - [ xvdh, /opt/data, "auto", "defaults,nobootwait", "0", "0" ] + - [ xvdh, /opt/data, "auto", "defaults,nofail", "0", "0" ] - [ dd, /dev/zero ] # mount_default_fields # These values are used to fill in any entries in 'mounts' that are not # complete. This must be an array, and must have 7 fields. -mount_default_fields: [ None, None, "auto", "defaults,nobootwait", "0", "2" ] +mount_default_fields: [ None, None, "auto", "defaults,nofail", "0", "2" ] # add each entry to ~/.ssh/authorized_keys for the configured user or the # first user defined in the user definition directive. diff --git a/tests/data/merge_sources/expected8.yaml b/tests/data/merge_sources/expected8.yaml index 69ca562d..360e38f0 100644 --- a/tests/data/merge_sources/expected8.yaml +++ b/tests/data/merge_sources/expected8.yaml @@ -3,5 +3,5 @@ mounts: - [ ephemeral22, /mnt, auto, "defaults,noexec" ] - [ sdc, /opt/data ] - - [ xvdh, /opt/data, "auto", "defaults,nobootwait", "0", "0" ] + - [ xvdh, /opt/data, "auto", "defaults,nofail", "0", "0" ] - [ dd, /dev/zero ] diff --git a/tests/data/merge_sources/source8-1.yaml b/tests/data/merge_sources/source8-1.yaml index 5ea51c2c..1ac1b0dd 100644 --- a/tests/data/merge_sources/source8-1.yaml +++ b/tests/data/merge_sources/source8-1.yaml @@ -3,5 +3,5 @@ mounts: - [ ephemeral0, /mnt, auto, "defaults,noexec" ] - [ sdc, /opt/data ] - - [ xvdh, /opt/data, "auto", "defaults,nobootwait", "0", "0" ] + - [ xvdh, /opt/data, "auto", "defaults,nofail", "0", "0" ] - [ dd, /dev/zero ] -- cgit v1.2.3