summaryrefslogtreecommitdiff
path: root/cloudinit/log.py
diff options
context:
space:
mode:
authorScott Moser <smoser@ubuntu.com>2012-11-07 10:29:49 -0500
committerScott Moser <smoser@ubuntu.com>2012-11-07 10:29:49 -0500
commite6d4b76e5e60ff558c247ad76acd27343afe367c (patch)
tree4a7f2b9fb1fe2dfed34cc36d9f3ef4a704179421 /cloudinit/log.py
parentce5a554672f4ffbc383af08a35d22a1dd89ce41f (diff)
parent180620470ba9aae4aac804b8bd66d3af8bd71ee4 (diff)
downloadvyos-cloud-init-e6d4b76e5e60ff558c247ad76acd27343afe367c.tar.gz
vyos-cloud-init-e6d4b76e5e60ff558c247ad76acd27343afe367c.zip
Add a more generic package install mechansim
This splits code in apt_update_upgrade into 'apt-update-upgrade' and 'apt-configure' and 'package-update-upgrade-install'. The 'package-update-upgrade-install' then uses the generic distro package mechanisms for acheiving the same goal. Also, adjusts some of the reboot backoffs and log flushing/sleeping that was happening there.
Diffstat (limited to 'cloudinit/log.py')
-rw-r--r--cloudinit/log.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/cloudinit/log.py b/cloudinit/log.py
index 2333e5ee..da6c2851 100644
--- a/cloudinit/log.py
+++ b/cloudinit/log.py
@@ -53,6 +53,18 @@ def setupBasicLogging():
root.setLevel(DEBUG)
+def flushLoggers(root):
+ if not root:
+ return
+ for h in root.handlers:
+ if isinstance(h, (logging.StreamHandler)):
+ try:
+ h.flush()
+ except IOError:
+ pass
+ flushLoggers(root.parent)
+
+
def setupLogging(cfg=None):
# See if the config provides any logging conf...
if not cfg: