1
Author: Scott Moser <smoser@ubuntu.com>
2
Bug: https://launchpad.net/bugs/1080985
3
Applied-Upstream: revno 743
4
Description: fix "resize_root: noblock"
6
was been broken in the 0.7.0 series. Using it would disable resizing.
7
=== modified file 'cloudinit/config/cc_resizefs.py'
8
--- a/cloudinit/config/cc_resizefs.py
9
+++ b/cloudinit/config/cc_resizefs.py
10
@@ -32,6 +32,8 @@ RESIZE_FS_PREFIXES_CMDS = [
11
('xfs', 'xfs_growfs'),
17
def nodeify_path(devpth, where, log):
19
@@ -68,7 +70,7 @@ def handle(name, cfg, cloud, log, args):
21
resize_root = util.get_cfg_option_str(cfg, "resize_rootfs", True)
23
- if not util.translate_bool(resize_root):
24
+ if not util.translate_bool(resize_root, addons=[NOBLOCK]):
25
log.debug("Skipping module named %s, resizing disabled", name)
28
@@ -111,7 +113,7 @@ def handle(name, cfg, cloud, log, args):
29
log.debug("Resizing %s (%s) using %s", resize_what, fs_type, resizer)
30
resize_cmd = [resizer, devpth]
32
- if resize_root == "noblock":
33
+ if resize_root == NOBLOCK:
34
# Fork to a child that will run
36
util.fork_cb(do_resize, resize_cmd, log)
37
@@ -121,7 +123,7 @@ def handle(name, cfg, cloud, log, args):
38
do_resize(resize_cmd, log)
41
- if resize_root == "noblock":
42
+ if resize_root == NOBLOCK:
43
action = 'Resizing (via forking)'
44
log.debug("%s root filesystem (type=%s, maj=%i, min=%i, val=%s)",
45
action, fs_type, os.major(st_dev), os.minor(st_dev), resize_root)