summaryrefslogtreecommitdiff
path: root/cloudinit/config/cc_resizefs.py
diff options
context:
space:
mode:
authorBen Howard <ben.howard@canonical.com>2013-08-20 09:58:30 -0600
committerBen Howard <ben.howard@canonical.com>2013-08-20 09:58:30 -0600
commit89d58c94d59c62dddea3f77b7a805c1afa2ca955 (patch)
tree6b7cd86a373706730f0ec11f06517fc2a003f7c9 /cloudinit/config/cc_resizefs.py
parente683ab2baa3e67614edcd409122bd1aec99737e0 (diff)
parentb2ee0966793f3a9c7d8e92ce1c13b9583a9a76e7 (diff)
downloadvyos-cloud-init-89d58c94d59c62dddea3f77b7a805c1afa2ca955.tar.gz
vyos-cloud-init-89d58c94d59c62dddea3f77b7a805c1afa2ca955.zip
Updated merge proposal with current tree
Diffstat (limited to 'cloudinit/config/cc_resizefs.py')
-rw-r--r--cloudinit/config/cc_resizefs.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/cloudinit/config/cc_resizefs.py b/cloudinit/config/cc_resizefs.py
index b4ee16b2..56040fdd 100644
--- a/cloudinit/config/cc_resizefs.py
+++ b/cloudinit/config/cc_resizefs.py
@@ -21,7 +21,6 @@
import errno
import os
import stat
-import time
from cloudinit.settings import PER_ALWAYS
from cloudinit import util
@@ -120,9 +119,12 @@ def handle(name, cfg, _cloud, log, args):
if resize_root == NOBLOCK:
# Fork to a child that will run
# the resize command
- util.fork_cb(do_resize, resize_cmd, log)
+ util.fork_cb(
+ util.log_time(logfunc=log.debug, msg="backgrounded Resizing",
+ func=do_resize, args=(resize_cmd, log)))
else:
- do_resize(resize_cmd, log)
+ util.log_time(logfunc=log.debug, msg="Resizing",
+ func=do_resize, args=(resize_cmd, log))
action = 'Resized'
if resize_root == NOBLOCK:
@@ -132,13 +134,10 @@ def handle(name, cfg, _cloud, log, args):
def do_resize(resize_cmd, log):
- start = time.time()
try:
util.subp(resize_cmd)
except util.ProcessExecutionError:
util.logexc(log, "Failed to resize filesystem (cmd=%s)", resize_cmd)
raise
- tot_time = time.time() - start
- log.debug("Resizing took %.3f seconds", tot_time)
# TODO(harlowja): Should we add a fsck check after this to make
# sure we didn't corrupt anything?