From e119877fcf9c38a89c4a054b146d8189b866d4e8 Mon Sep 17 00:00:00 2001 From: Scott Moser Date: Tue, 10 Jul 2012 17:47:02 -0400 Subject: send welcome message after logging has been applied in the 'cloud-init init' stages, we want the welcome message to get to the correct output as specified by the system's configuration. Ie, if the local /etc/cloud.config.d had 'output' or 'log_cfg' settings we want those to be able to affect the welcome message also. In normal operation, nothing else will go to stdout or stderr before this, and likely/hopefully nothing terribly important to the logs. --- cloudinit/util.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'cloudinit') diff --git a/cloudinit/util.py b/cloudinit/util.py index 6501cbdf..e7a2ebcd 100644 --- a/cloudinit/util.py +++ b/cloudinit/util.py @@ -288,8 +288,10 @@ def multi_log(text, console=True, stderr=True, wfh.write(text) wfh.flush() if log: - log.log(log_level, text) - + if text[-1] == "\n": + log.log(log_level, text[:-1]) + else: + log.log(log_level, text) def is_ipv4(instr): """ determine if input string is a ipv4 address. return boolean""" -- cgit v1.2.3