summaryrefslogtreecommitdiff
path: root/cloudinit/config/cc_resizefs.py
diff options
context:
space:
mode:
authorScott Moser <smoser@ubuntu.com>2012-11-20 01:05:36 -0500
committerScott Moser <smoser@ubuntu.com>2012-11-20 01:05:36 -0500
commitd324a2cb0b10a4cd1b1b05dd23d0040ab3e9621c (patch)
treec5212b60e3e5b7bbafb47fad81b02ae3c387fc43 /cloudinit/config/cc_resizefs.py
parent3cb9a6ed620ab9200a18bf69cdac5ac518ca214c (diff)
downloadvyos-cloud-init-d324a2cb0b10a4cd1b1b05dd23d0040ab3e9621c.tar.gz
vyos-cloud-init-d324a2cb0b10a4cd1b1b05dd23d0040ab3e9621c.zip
fix "resize_root: noblock"
resize_root: noblock has been broken in the 0.7.0 series. Using it would disable resizing. LP: #1080985
Diffstat (limited to 'cloudinit/config/cc_resizefs.py')
-rw-r--r--cloudinit/config/cc_resizefs.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/cloudinit/config/cc_resizefs.py b/cloudinit/config/cc_resizefs.py
index b958f332..70294eda 100644
--- a/cloudinit/config/cc_resizefs.py
+++ b/cloudinit/config/cc_resizefs.py
@@ -32,6 +32,8 @@ RESIZE_FS_PREFIXES_CMDS = [
('xfs', 'xfs_growfs'),
]
+NOBLOCK = "noblock"
+
def nodeify_path(devpth, where, log):
try:
@@ -68,7 +70,7 @@ def handle(name, cfg, _cloud, log, args):
else:
resize_root = util.get_cfg_option_str(cfg, "resize_rootfs", True)
- if not util.translate_bool(resize_root):
+ if not util.translate_bool(resize_root, addons=[NOBLOCK]):
log.debug("Skipping module named %s, resizing disabled", name)
return
@@ -110,7 +112,7 @@ def handle(name, cfg, _cloud, log, args):
log.debug("Resizing %s (%s) using %s", resize_what, fs_type, resizer)
resize_cmd = [resizer, devpth]
- if resize_root == "noblock":
+ if resize_root == NOBLOCK:
# Fork to a child that will run
# the resize command
util.fork_cb(do_resize, resize_cmd, log)
@@ -120,7 +122,7 @@ def handle(name, cfg, _cloud, log, args):
do_resize(resize_cmd, log)
action = 'Resized'
- if resize_root == "noblock":
+ if resize_root == NOBLOCK:
action = 'Resizing (via forking)'
log.debug("%s root filesystem (type=%s, maj=%i, min=%i, val=%s)",
action, fs_type, os.major(st_dev), os.minor(st_dev), resize_root)