added diff to assemble for remote_src=false

pull/11975/head
Brian Coca 9 years ago
parent f048aca5f6
commit 1b7369cc8d

@ -110,17 +110,13 @@ class ActionModule(ActionBase):
dest = self._remote_expand_user(dest, tmp)
remote_checksum = self._remote_checksum(tmp, dest, all_vars=task_vars)
diff = {}
if path_checksum != remote_checksum:
resultant = file(path).read()
# FIXME: diff needs to be moved somewhere else
#if self.runner.diff:
# dest_result = self._execute_module(module_name='slurp', module_args=dict(path=dest), task_vars=task_vars, tmp=tmp, persist_files=True)
# if 'content' in dest_result:
# dest_contents = dest_result['content']
# if dest_result['encoding'] == 'base64':
# dest_contents = base64.b64decode(dest_contents)
# else:
# raise Exception("unknown encoding, failed: %s" % dest_result)
if self._play_context.diff:
diff = self._get_diff_data(tmp, dest, path, task_vars)
xfered = self._transfer_data('src', resultant)
# fix file permissions when the copy is done as a different user
@ -139,8 +135,8 @@ class ActionModule(ActionBase):
)
res = self._execute_module(module_name='copy', module_args=new_module_args, task_vars=task_vars, tmp=tmp)
# FIXME: diff stuff
#res.diff = dict(after=resultant)
if diff:
res['diff'] = diff
return res
else:
new_module_args = self._task.args.copy()

Loading…
Cancel
Save