Fixup result dictionary when copy module calls file module
This commit is contained in:
parent
6fb02650ff
commit
ef2df8157a
1 changed files with 7 additions and 0 deletions
|
@ -258,6 +258,8 @@ class ActionModule(object):
|
||||||
module_executed = True
|
module_executed = True
|
||||||
|
|
||||||
module_result = module_return.result
|
module_result = module_return.result
|
||||||
|
if not module_result.get('md5sum'):
|
||||||
|
module_result['md5sum'] = local_md5
|
||||||
if module_result.get('failed') == True:
|
if module_result.get('failed') == True:
|
||||||
return module_return
|
return module_return
|
||||||
if module_result.get('changed') == True:
|
if module_result.get('changed') == True:
|
||||||
|
@ -268,6 +270,11 @@ class ActionModule(object):
|
||||||
or (not C.DEFAULT_KEEP_REMOTE_FILES and delete_remote_tmp and not module_executed):
|
or (not C.DEFAULT_KEEP_REMOTE_FILES and delete_remote_tmp and not module_executed):
|
||||||
self.runner._remove_tmp_path(conn, tmp_path)
|
self.runner._remove_tmp_path(conn, tmp_path)
|
||||||
|
|
||||||
|
# the file module returns the file path as 'path', but
|
||||||
|
# the copy module uses 'dest', so add it if it's not there
|
||||||
|
if 'path' in module_result and 'dest' not in module_result:
|
||||||
|
module_result['dest'] = module_result['path']
|
||||||
|
|
||||||
# TODO: Support detailed status/diff for multiple files
|
# TODO: Support detailed status/diff for multiple files
|
||||||
if len(source_files) == 1:
|
if len(source_files) == 1:
|
||||||
result = module_result
|
result = module_result
|
||||||
|
|
Loading…
Reference in a new issue