From 879946c26f005f5ae5c2bbdd537beb295d7f4773 Mon Sep 17 00:00:00 2001 From: Joshua Harlow Date: Mon, 2 Jul 2012 10:56:22 -0700 Subject: 1. Move the welcome message template string to a constant at the top of the module 2. Fix the usage of multi_log to log to only one of the places (for now) 3. Update comment about multi-log and why write_file isn't used in this case --- cloudinit/util.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'cloudinit/util.py') diff --git a/cloudinit/util.py b/cloudinit/util.py index 6b23a0ee..4c29432b 100644 --- a/cloudinit/util.py +++ b/cloudinit/util.py @@ -275,15 +275,18 @@ def find_modules(root_dir): return entries -def multi_log(text, console=True, stderr=True, log=None): +def multi_log(text, console=True, stderr=True, + log=None, log_level=logging.DEBUG): if stderr: sys.stderr.write(text) if console: + # Don't use the write_file since + # this might be 'sensitive' info (not debug worthy?) with open('/dev/console', 'wb') as wfh: wfh.write(text) wfh.flush() if log: - log.debug(text) + log.log(log_level, text) def is_ipv4(instr): -- cgit v1.2.3