summaryrefslogtreecommitdiff
path: root/cloudinit/util.py
diff options
context:
space:
mode:
authorharlowja <harlowja@virtualbox.rhel>2012-07-01 12:14:12 -0700
committerharlowja <harlowja@virtualbox.rhel>2012-07-01 12:14:12 -0700
commit346739701b2de2db2bf2065d946d611d55bc5653 (patch)
treedf2d11b7987ab67e457e126a84a738695d9f8eb7 /cloudinit/util.py
parent9e1ffb27f4f316638a1fe83678c19f7215a8ef4b (diff)
parentaa9189e89ec101fba8ca36919a7c800f8b28d5c0 (diff)
downloadvyos-cloud-init-346739701b2de2db2bf2065d946d611d55bc5653.tar.gz
vyos-cloud-init-346739701b2de2db2bf2065d946d611d55bc5653.zip
Merge in pending changes.
Diffstat (limited to 'cloudinit/util.py')
-rw-r--r--cloudinit/util.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/cloudinit/util.py b/cloudinit/util.py
index f07d22e7..6b23a0ee 100644
--- a/cloudinit/util.py
+++ b/cloudinit/util.py
@@ -275,6 +275,17 @@ def find_modules(root_dir):
return entries
+def multi_log(text, console=True, stderr=True, log=None):
+ if stderr:
+ sys.stderr.write(text)
+ if console:
+ with open('/dev/console', 'wb') as wfh:
+ wfh.write(text)
+ wfh.flush()
+ if log:
+ log.debug(text)
+
+
def is_ipv4(instr):
""" determine if input string is a ipv4 address. return boolean"""
toks = instr.split('.')