fix "resize_root: noblock"

resize_root: noblock
has been broken in the 0.7.0 series.  Using it would disable resizing.
This commit is contained in:
Scott Moser 2012-11-20 01:05:36 -05:00
parent 714338fc7d
commit a1d8dbe890
2 changed files with 6 additions and 3 deletions

View File

@ -1,6 +1,7 @@
0.7.2:
- add a debian watch file
- add 'sudo' entry to ubuntu's default user (LP: #1080717)
- fix resizefs module when 'noblock' was provided (LP: #1080985)
0.7.1:
- sysvinit: fix missing dependency in cloud-init job for RHEL 5.6
- config-drive: map hostname to local-hostname (LP: #1061964)

View File

@ -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)