From 7ecdb83800321cb5c54cf8e81f9d0fae1525a446 Mon Sep 17 00:00:00 2001 From: Dave Hatton Date: Wed, 11 Jul 2012 09:35:10 +0100 Subject: [PATCH] improve output formating for playbook --- bin/ansible-playbook | 2 +- lib/ansible/callbacks.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/bin/ansible-playbook b/bin/ansible-playbook index 0e44ffe592..22a821ddba 100755 --- a/bin/ansible-playbook +++ b/bin/ansible-playbook @@ -87,7 +87,7 @@ def main(args): print callbacks.banner("PLAY RECAP") for h in hosts: t = pb.stats.summarize(h) - print "%-30s : ok=%4s changed=%4s unreachable=%4s failed=%4s " % (h, + print "%-30s : ok=%-4s changed=%-4s unreachable=%-4s failed=%-4s " % (h, t['ok'], t['changed'], t['unreachable'], t['failures'] ) print "\n" diff --git a/lib/ansible/callbacks.py b/lib/ansible/callbacks.py index 8921a99423..7bbbf39793 100644 --- a/lib/ansible/callbacks.py +++ b/lib/ansible/callbacks.py @@ -84,7 +84,7 @@ def banner(msg): (out, err) = cmd.communicate() res = "%s\n" % out else: - res = "%s ********************* \n" % msg + res = "\n%s ********************* " % msg return res @@ -190,7 +190,7 @@ class PlaybookRunnerCallbacks(DefaultRunnerCallbacks): def on_ok(self, host, host_result): # show verbose output for non-setup module results if --verbose is used if not self.verbose or host_result.get("verbose_override",None) is not None: - print "ok: [%s]\n" % (host) + print "ok: [%s]" % (host) else: print "ok: [%s] => %s" % (host, utils.smjson(host_result)) @@ -225,7 +225,7 @@ class PlaybookCallbacks(object): self.verbose = verbose def on_start(self): - print "\n" + pass def on_notify(self, host, handler): pass