mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
format fixes to make fetch more usable
This commit is contained in:
parent
b542dd8466
commit
c3205595b3
2 changed files with 6 additions and 6 deletions
|
@ -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):
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue