Fix "resize_root: noblock"

https://launchpad.net/bugs/1080985
This commit is contained in:
Garrett Holmstrom 2012-11-21 13:55:04 -08:00
parent 82213acfcc
commit fac1467953
2 changed files with 45 additions and 0 deletions

View File

@ -0,0 +1,40 @@
Index: cloud-init-0.7.1/cloudinit/config/cc_resizefs.py
===================================================================
--- cloud-init-0.7.1.orig/cloudinit/config/cc_resizefs.py
+++ cloud-init-0.7.1/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)

View File

@ -15,6 +15,10 @@ Patch0: cloud-init-0.7.0-fedora.patch
# Fix broken sudoers file generation
# http://bazaar.launchpad.net/~cloud-init-dev/cloud-init/trunk/revision/740
Patch1: cloud-init-0.7.1-sudo-iterstr.patch
# Fix "resize_root: noblock"
# https://launchpad.net/bugs/1080985
# http://bazaar.launchpad.net/~cloud-init-dev/cloud-init/trunk/revision/743
Patch2: cloud-init-0.7.1-noblock.patch
BuildArch: noarch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@ -132,6 +136,7 @@ fi
* Wed Nov 21 2012 Garrett Holmstrom <gholms@fedoraproject.org> - 0.7.1-1
- Rebased against version 0.7.1
- Fixed broken sudoers file generation
- Fixed "resize_root: noblock" [LP:1080985]
* Tue Oct 9 2012 Garrett Holmstrom <gholms@fedoraproject.org> - 0.7.0-1
- Rebased against version 0.7.0