diff options
author | Chad Smith <chad.smith@canonical.com> | 2018-04-03 17:01:38 -0600 |
---|---|---|
committer | Chad Smith <chad.smith@canonical.com> | 2018-04-03 17:01:38 -0600 |
commit | 2901835b6ab89f553ce4c3bb22451fad5f3a4f68 (patch) | |
tree | 444f44ab4dece9b8daba3feff89204547c22fab8 /cloudinit | |
parent | 710dbc8293706ab004326ce9b882bceb6e8cca93 (diff) | |
parent | 05926e48eae0fa70a26da6449617e04e87c4e704 (diff) | |
download | vyos-cloud-init-2901835b6ab89f553ce4c3bb22451fad5f3a4f68.tar.gz vyos-cloud-init-2901835b6ab89f553ce4c3bb22451fad5f3a4f68.zip |
merge from master at 18.2-4-g05926e48
Diffstat (limited to 'cloudinit')
-rw-r--r-- | cloudinit/config/cc_resizefs.py | 2 | ||||
-rw-r--r-- | cloudinit/config/cc_users_groups.py | 28 | ||||
-rw-r--r-- | cloudinit/util.py | 10 |
3 files changed, 25 insertions, 15 deletions
diff --git a/cloudinit/config/cc_resizefs.py b/cloudinit/config/cc_resizefs.py index c8e1752f..013e69b5 100644 --- a/cloudinit/config/cc_resizefs.py +++ b/cloudinit/config/cc_resizefs.py @@ -251,6 +251,8 @@ def handle(name, cfg, _cloud, log, args): if fs_type == 'zfs': zpool = devpth.split('/')[0] devpth = util.get_device_info_from_zpool(zpool) + if not devpth: + return # could not find device from zpool resize_what = zpool info = "dev=%s mnt_point=%s path=%s" % (devpth, mount_point, resize_what) diff --git a/cloudinit/config/cc_users_groups.py b/cloudinit/config/cc_users_groups.py index f363000d..b215e95a 100644 --- a/cloudinit/config/cc_users_groups.py +++ b/cloudinit/config/cc_users_groups.py @@ -34,16 +34,16 @@ config keys for an entry in ``users`` are as follows: - ``homedir``: Optional. Home dir for user. Default is ``/home/<username>`` - ``inactive``: Optional. Mark user inactive. Default: false - ``lock_passwd``: Optional. Disable password login. Default: true - - ``no-create-home``: Optional. Do not create home directory. Default: + - ``no_create_home``: Optional. Do not create home directory. Default: false - - ``no-log-init``: Optional. Do not initialize lastlog and faillog for + - ``no_log_init``: Optional. Do not initialize lastlog and faillog for user. Default: false - - ``no-user-group``: Optional. Do not create group named after user. + - ``no_user_group``: Optional. Do not create group named after user. Default: false - ``passwd``: Hash of user password - - ``primary-group``: Optional. Primary group for user. Default to new group + - ``primary_group``: Optional. Primary group for user. Default to new group named after user. - - ``selinux-user``: Optional. SELinux user for user's login. Default to + - ``selinux_user``: Optional. SELinux user for user's login. Default to default SELinux user. - ``shell``: Optional. The user's login shell. The default is to set no shell, which results in a system-specific default being used. @@ -51,9 +51,9 @@ config keys for an entry in ``users`` are as follows: a Snappy user through ``snap create-user``. If an Ubuntu SSO account is associated with the address, username and SSH keys will be requested from there. Default: none - - ``ssh-authorized-keys``: Optional. List of ssh keys to add to user's + - ``ssh_authorized_keys``: Optional. List of ssh keys to add to user's authkeys file. Default: none - - ``ssh-import-id``: Optional. SSH id to import for user. Default: none + - ``ssh_import_id``: Optional. SSH id to import for user. Default: none - ``sudo``: Optional. Sudo rule to use, or list of sudo rules to use. Default: none. - ``system``: Optional. Create user as system user with no home directory. @@ -89,18 +89,18 @@ config keys for an entry in ``users`` are as follows: homedir: <home directory> inactive: <true/false> lock_passwd: <true/false> - no-create-home: <true/false> - no-log-init: <true/false> - no-user-group: <true/false> + no_create_home: <true/false> + no_log_init: <true/false> + no_user_group: <true/false> passwd: <password> - primary-group: <primary group> - selinux-user: <selinux username> + primary_group: <primary group> + selinux_user: <selinux username> shell: <shell path> snapuser: <email> - ssh-authorized-keys: + ssh_authorized_keys: - <key> - <key> - ssh-import-id: <id> + ssh_import_id: <id> sudo: <sudo config> system: <true/false> uid: <user id> diff --git a/cloudinit/util.py b/cloudinit/util.py index 0ab2c484..acdc0d85 100644 --- a/cloudinit/util.py +++ b/cloudinit/util.py @@ -2249,7 +2249,15 @@ def get_mount_info_freebsd(path): def get_device_info_from_zpool(zpool): - (zpoolstatus, err) = subp(['zpool', 'status', zpool]) + # zpool has 10 second timeout waiting for /dev/zfs LP: #1760173 + if not os.path.exists('/dev/zfs'): + LOG.debug('Cannot get zpool info, no /dev/zfs') + return None + try: + (zpoolstatus, err) = subp(['zpool', 'status', zpool]) + except ProcessExecutionError as err: + LOG.warning("Unable to get zpool status of %s: %s", zpool, err) + return None if len(err): return None r = r'.*(ONLINE).*' |