From c436e173c4162c940523a2978799193672ff9cd3 Mon Sep 17 00:00:00 2001 From: Ryan Harper Date: Mon, 2 Apr 2018 13:33:39 -0600 Subject: cc_resizefs, util: handle no /dev/zfs The zfs/zpool commands will hang for 10 seconds if /dev/zfs is not present (bug 1760173). This is a common occurence for containers using zfs as rootfs. Additionally handle missing zpool command or other errors that may occur while executing the zpool command. --- cloudinit/config/cc_resizefs.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'cloudinit/config/cc_resizefs.py') 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) -- cgit v1.2.3