diff options
author | Scott Moser <smoser@ubuntu.com> | 2014-09-15 20:27:31 -0400 |
---|---|---|
committer | Scott Moser <smoser@ubuntu.com> | 2014-09-15 20:27:31 -0400 |
commit | 5d51578e5aaa3fd96eb7505a0d625abe65553a67 (patch) | |
tree | 2806781d0a1c718cf5adc7c43dd41243a17f5900 | |
parent | 6093b8b2733814b9265494c47f4268167c9491ab (diff) | |
parent | bea35b7685978804557aada44c819c536ab209b3 (diff) | |
download | vyos-cloud-init-5d51578e5aaa3fd96eb7505a0d625abe65553a67.tar.gz vyos-cloud-init-5d51578e5aaa3fd96eb7505a0d625abe65553a67.zip |
resizefs: fix backgrounded resizing
add kwargs to fork_cb, and utilize that to call log_time and pass through
the provided args to resize_cmd.
LP: #1338614
-rw-r--r-- | ChangeLog | 1 | ||||
-rw-r--r-- | cloudinit/config/cc_resizefs.py | 4 | ||||
-rw-r--r-- | cloudinit/util.py | 4 |
3 files changed, 5 insertions, 4 deletions
@@ -34,6 +34,7 @@ - resizefs: first check that device is writable. - configdrive: fix reading of vendor data to be like metadata service reader. [Jay Faulkner] + - resizefs: fix broken background resizing [Jay Faulkner] (LP: #1338614) 0.7.5: - open 0.7.5 - Add a debug log message around import failures diff --git a/cloudinit/config/cc_resizefs.py b/cloudinit/config/cc_resizefs.py index 7e796228..cbc07853 100644 --- a/cloudinit/config/cc_resizefs.py +++ b/cloudinit/config/cc_resizefs.py @@ -162,8 +162,8 @@ def handle(name, cfg, _cloud, log, args): # Fork to a child that will run # the resize command util.fork_cb( - util.log_time(logfunc=log.debug, msg="backgrounded Resizing", - func=do_resize, args=(resize_cmd, log))) + util.log_time, logfunc=log.debug, msg="backgrounded Resizing", + func=do_resize, args=(resize_cmd, log)) else: util.log_time(logfunc=log.debug, msg="Resizing", func=do_resize, args=(resize_cmd, log)) diff --git a/cloudinit/util.py b/cloudinit/util.py index bdb0f268..946059e9 100644 --- a/cloudinit/util.py +++ b/cloudinit/util.py @@ -191,11 +191,11 @@ def ExtendedTemporaryFile(**kwargs): return fh -def fork_cb(child_cb, *args): +def fork_cb(child_cb, *args, **kwargs): fid = os.fork() if fid == 0: try: - child_cb(*args) + child_cb(*args, **kwargs) os._exit(0) except: logexc(LOG, "Failed forking and calling callback %s", |