summaryrefslogtreecommitdiff
path: root/cloudinit
diff options
context:
space:
mode:
authorScott Moser <smoser@ubuntu.com>2013-03-04 16:59:57 -0500
committerScott Moser <smoser@ubuntu.com>2013-03-04 16:59:57 -0500
commitab73a5a7befb9583a9b2cee35fa99e363793c116 (patch)
tree5233d2100018e767adc26474a9a02896907d034e /cloudinit
parentc1625a5f90d4f08b193e4fcfc3238bb32bcf61df (diff)
downloadvyos-cloud-init-ab73a5a7befb9583a9b2cee35fa99e363793c116.tar.gz
vyos-cloud-init-ab73a5a7befb9583a9b2cee35fa99e363793c116.zip
add the unit test, fix a few issues
Diffstat (limited to 'cloudinit')
-rw-r--r--cloudinit/config/cc_growpart.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/cloudinit/config/cc_growpart.py b/cloudinit/config/cc_growpart.py
index 206cfc94..d49159ed 100644
--- a/cloudinit/config/cc_growpart.py
+++ b/cloudinit/config/cc_growpart.py
@@ -32,6 +32,7 @@ def resizer_factory(mode):
cur = resizer()
if cur.available():
resize_class = cur
+ break
if not resize_class:
raise ValueError("No resizers available")
@@ -65,7 +66,7 @@ class ResizeParted(object):
try:
(out, _err) = util.subp(["parted", "--help"], env=myenv)
- if re.search("COMMAND.*resize\s+", out, re.DOTALL):
+ if re.search("COMMAND.*resizepart\s+", out, re.DOTALL):
return True
except util.ProcessExecutionError:
@@ -193,6 +194,9 @@ def handle(name, cfg, _cloud, log, _args):
resizer = resizer_factory(mode)
except (ValueError, TypeError) as e:
log.debug("growpart unable to find resizer for '%s': %s" % (mode, e))
+ if mode != "auto":
+ raise e
+ return
devices = util.get_cfg_option_list(cfg, "devices", ["/"])
if not len(devices):