diff --git a/lib/ansible/runner/__init__.py b/lib/ansible/runner/__init__.py index 6025cd765c6..82568e021e6 100644 --- a/lib/ansible/runner/__init__.py +++ b/lib/ansible/runner/__init__.py @@ -621,7 +621,7 @@ class Runner(object): # ***************************************************** def _remote_md5(self, conn, tmp, path): - ''' takes a remote md5sum without requiring python, and returns 0 if no file ''' + ''' takes a remote md5sum without requiring python, and returns 1 if no file ''' path = pipes.quote(path) # The following test needs to be SH-compliant. BASH-isms will diff --git a/lib/ansible/runner/action_plugins/copy.py b/lib/ansible/runner/action_plugins/copy.py index bc03d15dedf..4322fbfd331 100644 --- a/lib/ansible/runner/action_plugins/copy.py +++ b/lib/ansible/runner/action_plugins/copy.py @@ -106,8 +106,8 @@ class ActionModule(object): dest = os.path.join(dest, os.path.basename(source)) remote_md5 = self.runner._remote_md5(conn, tmp, dest) - # remote_md5 == '0' would mean that the file does not exist. - if remote_md5 != '0' and not force: + # remote_md5 == '1' would mean that the file does not exist. + if remote_md5 != '1' and not force: return ReturnData(conn=conn, result=dict(changed=False)) exec_rc = None