diff --git a/lib/ansible/plugins/action/fetch.py b/lib/ansible/plugins/action/fetch.py index 69cec30742..2d32744294 100644 --- a/lib/ansible/plugins/action/fetch.py +++ b/lib/ansible/plugins/action/fetch.py @@ -121,31 +121,23 @@ class ActionModule(ActionBase): if remote_checksum in ('0', '1', '2', '3', '4'): # these don't fail because you may want to transfer a log file that # possibly MAY exist but keep going to fetch other log files + result['changed'] = False + result['file'] = source if remote_checksum == '0': result['msg'] = "unable to calculate the checksum of the remote file" - result['file'] = source - result['changed'] = False elif remote_checksum == '1': if fail_on_missing: result['failed'] = True + del result['changed'] result['msg'] = "the remote file does not exist" - result['file'] = source else: result['msg'] = "the remote file does not exist, not transferring, ignored" - result['file'] = source - result['changed'] = False elif remote_checksum == '2': result['msg'] = "no read permission on remote file, not transferring, ignored" - result['file'] = source - result['changed'] = False elif remote_checksum == '3': result['msg'] = "remote file is a directory, fetch cannot work on directories" - result['file'] = source - result['changed'] = False elif remote_checksum == '4': result['msg'] = "python isn't present on the system. Unable to compute checksum" - result['file'] = source - result['changed'] = False return result # calculate checksum for the local file