From a23be741c23978064d0fe6ff6bd8e7fcf0c2cfa8 Mon Sep 17 00:00:00 2001 From: Scott Moser Date: Thu, 3 Mar 2011 17:15:12 -0500 Subject: cc_resizefs.py: log output of failed resizefs or blkid commands --- cloudinit/CloudConfig/cc_resizefs.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cloudinit/CloudConfig/cc_resizefs.py b/cloudinit/CloudConfig/cc_resizefs.py index cb974927..ebb95227 100644 --- a/cloudinit/CloudConfig/cc_resizefs.py +++ b/cloudinit/CloudConfig/cc_resizefs.py @@ -34,8 +34,9 @@ def handle(name,cfg,cloud,log,args): cmd = ['blkid', '-c', '/dev/null', '-sTYPE', '-ovalue', '/dev/root'] try: (fstype,err) = util.subp(cmd) - except Exception as e: + except subprocess.CalledProcessError as e: log.warn("Failed to get filesystem type via %s" % cmd) + log.warn("output=%s\nerror=%s\n", e.output[0], e.output[1]) raise if fstype.startswith("ext"): @@ -48,7 +49,8 @@ def handle(name,cfg,cloud,log,args): try: (out,err) = util.subp(resize_cmd) - except Exception as e: + except subprocess.CalledProcessError as e: log.warn("Failed to resize filesystem (%s)" % resize_cmd) + log.warn("output=%s\nerror=%s\n", e.output[0], e.output[1]) raise -- cgit v1.2.3