summaryrefslogtreecommitdiffstats
path: root/callback_plugins
diff options
context:
space:
mode:
authorRalph Bean <rbean@redhat.com>2015-02-02 15:52:29 +0000
committerRalph Bean <rbean@redhat.com>2015-02-02 15:52:34 +0000
commitf6584f747f70994eca3cb4316a74be1f01a8a8a9 (patch)
tree7de609b2a5df68f9bb80e5b9a2741f15979a8e7f /callback_plugins
parent278df3e047d025dfcc56c4990c0252bf8250901a (diff)
downloadansible-f6584f747f70994eca3cb4316a74be1f01a8a8a9.tar.gz
ansible-f6584f747f70994eca3cb4316a74be1f01a8a8a9.tar.xz
ansible-f6584f747f70994eca3cb4316a74be1f01a8a8a9.zip
Kill that whitespace more carefully.
Diffstat (limited to 'callback_plugins')
-rw-r--r--callback_plugins/logdetail.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/callback_plugins/logdetail.py b/callback_plugins/logdetail.py
index bab951b43..fc328a048 100644
--- a/callback_plugins/logdetail.py
+++ b/callback_plugins/logdetail.py
@@ -138,10 +138,15 @@ class LogMech(object):
elif self.play_info.get('check', False):
category = 'CHECK:' + category
+ # Sometimes this is None.. othertimes it's fine. Othertimes it has
+ # trailing whitespace that kills logview. Strip that, when possible.
+ if name:
+ name = name.strip()
+
sanitize_host = host.replace(' ', '_').replace('>', '-')
fd = open(self.logpath_play + '/' + sanitize_host + '.log', 'a')
now = time.strftime(TIME_FORMAT, time.localtime())
- fd.write(MSG_FORMAT % dict(now=now, name=name.strip(), count=count, category=category, data=json.dumps(data)))
+ fd.write(MSG_FORMAT % dict(now=now, name=name, count=count, category=category, data=json.dumps(data)))
fd.close()