~smoser/ubuntu/quantal/cloud-init/sru

« back to all changes in this revision

Viewing changes to debian/patches/lp-1080985-fix-resize-root-noblock.patch

  • Committer: Scott Moser
  • Date: 2012-11-29 15:29:22 UTC
  • Revision ID: smoser@brickies.net-20121129152922-z2g2z12fgopxpqjb
debian/patches/lp-1080985-fix-resize-root-noblock.patch:
fix 'resize_root: noblock' (LP: #1080985)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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"
 
5
 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'),
 
12
 ]
 
13
 
 
14
+NOBLOCK = "noblock"
 
15
+
 
16
 
 
17
 def nodeify_path(devpth, where, log):
 
18
     try:
 
19
@@ -68,7 +70,7 @@ def handle(name, cfg, cloud, log, args):
 
20
     else:
 
21
         resize_root = util.get_cfg_option_str(cfg, "resize_rootfs", True)
 
22
 
 
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)
 
26
         return
 
27
 
 
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]
 
31
 
 
32
-        if resize_root == "noblock":
 
33
+        if resize_root == NOBLOCK:
 
34
             # Fork to a child that will run
 
35
             # the resize command
 
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)
 
39
 
 
40
     action = 'Resized'
 
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)