diff options
Diffstat (limited to 'cloudinit')
-rw-r--r-- | cloudinit/config/cc_resizefs.py | 2 | ||||
-rw-r--r-- | cloudinit/util.py | 10 |
2 files changed, 11 insertions, 1 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/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).*' |