From eafbf6f46d6d2a7ff9432b255a54e5ed368f911c Mon Sep 17 00:00:00 2001 From: Dave Hatton Date: Mon, 16 Jul 2012 11:43:37 +0100 Subject: [PATCH] format fixes to make fetch more usable --- lib/ansible/callbacks.py | 6 +++--- lib/ansible/runner/__init__.py | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/ansible/callbacks.py b/lib/ansible/callbacks.py index c3ab099ca9f..b393158dd1e 100644 --- a/lib/ansible/callbacks.py +++ b/lib/ansible/callbacks.py @@ -252,7 +252,7 @@ class PlaybookRunnerCallbacks(DefaultRunnerCallbacks): def on_failed(self, host, results): - print "failed: [%s] => %s\n" % (host, utils.jsonify(results)) + print "failed: [%s] => %s" % (host, utils.jsonify(results)) def on_ok(self, host, host_result): @@ -264,11 +264,11 @@ class PlaybookRunnerCallbacks(DefaultRunnerCallbacks): def on_error(self, host, err): - print >>sys.stderr, "err: [%s] => %s\n" % (host, err) + print >>sys.stderr, "err: [%s] => %s" % (host, err) def on_skipped(self, host): - print "skipping: [%s]\n" % host + print "skipping: [%s]" % host def on_no_hosts(self): diff --git a/lib/ansible/runner/__init__.py b/lib/ansible/runner/__init__.py index 74c9314e6c8..ef2679a62a9 100644 --- a/lib/ansible/runner/__init__.py +++ b/lib/ansible/runner/__init__.py @@ -422,7 +422,7 @@ class Runner(object): remote_md5 = self._remote_md5(conn, tmp, source) if remote_md5 == '0': - result = dict(msg="missing remote file: %s" % source, changed=False) + result = dict(msg="missing remote file", file=source, changed=False) return ReturnData(host=conn.host, result=result) elif remote_md5 != local_md5: # create the containing directories, if needed @@ -433,12 +433,12 @@ class Runner(object): conn.fetch_file(source, dest) new_md5 = utils.md5(dest) if new_md5 != remote_md5: - result = dict(failed=True, msg="md5 mismatch", md5sum=new_md5) + result = dict(failed=True, md5sum=new_md5, msg="md5 mismatch", file=source) return ReturnData(host=conn.host, result=result) result = dict(changed=True, md5sum=new_md5) return ReturnData(host=conn.host, result=result) else: - result = dict(changed=False, md5sum=local_md5) + result = dict(changed=False, md5sum=local_md5, file=source) return ReturnData(host=conn.host, result=result)