summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Moser <smoser@ubuntu.com>2013-07-30 14:28:09 -0400
committerScott Moser <smoser@ubuntu.com>2013-07-30 14:28:09 -0400
commit0ca150b08433fbc57e10d599a46e300142c955c5 (patch)
tree4afcc24f3d00a08b5cd442fc0a0e81a15a653e36
parent66490ebb92af59d148f79aae42a2eddc1ecedb7e (diff)
downloadvyos-cloud-init-0ca150b08433fbc57e10d599a46e300142c955c5.tar.gz
vyos-cloud-init-0ca150b08433fbc57e10d599a46e300142c955c5.zip
set reading /proc/uptime to false by default.
reading /proc/uptime is going to be slower, and no reason to do it on most things. Better to only do it when you suspect maybe a need for it.
-rwxr-xr-xbin/cloud-init5
-rw-r--r--cloudinit/sources/DataSourceAzure.py5
-rw-r--r--cloudinit/util.py2
3 files changed, 6 insertions, 6 deletions
diff --git a/bin/cloud-init b/bin/cloud-init
index bd9ddc04..b4f9fd07 100755
--- a/bin/cloud-init
+++ b/bin/cloud-init
@@ -503,9 +503,8 @@ def main():
(name, functor) = args.action
- return util.log_time(logfunc=LOG.debug,
- msg="cloud-init mode '%s'" % name, uptime=True,
- func=functor, args=(name, args))
+ return util.log_time(logfunc=LOG.debug, msg="cloud-init mode '%s'" % name,
+ get_uptime=True, func=functor, args=(name, args))
if __name__ == '__main__':
diff --git a/cloudinit/sources/DataSourceAzure.py b/cloudinit/sources/DataSourceAzure.py
index f906b8fa..1a74de21 100644
--- a/cloudinit/sources/DataSourceAzure.py
+++ b/cloudinit/sources/DataSourceAzure.py
@@ -207,8 +207,9 @@ def apply_hostname_bounce(hostname, policy, interface, command,
shell = not isinstance(command, (list, tuple))
# capture=False, see comments in bug 1202758 and bug 1206164.
util.log_time(logfunc=LOG.debug, msg="publishing hostname",
- func=util.subp, kwargs={'command': command, 'shell': shell,
- 'capture': False, 'env': env})
+ get_uptime=True, func=util.subp,
+ kwargs={'command': command, 'shell': shell, 'capture': False,
+ 'env': env})
def crtfile_to_pubkey(fname):
diff --git a/cloudinit/util.py b/cloudinit/util.py
index b0eb56e6..4a74ba57 100644
--- a/cloudinit/util.py
+++ b/cloudinit/util.py
@@ -1772,7 +1772,7 @@ def which(program):
return None
-def log_time(logfunc, msg, func, args=None, kwargs=None, get_uptime=True):
+def log_time(logfunc, msg, func, args=None, kwargs=None, get_uptime=False):
if args is None:
args = []
if kwargs is None: