Fix #4202: Can't unarchive remote files (#4244)

When you try to remote unarchive files with the option copy=no the code always fail, as evidenced in issue #4202. That happens because the conditional to check "if remote_src=no or copy=yes" will always be true since the default value of them is remote_src=no and copy=yes.
My modification is only to change the condition from or to and, that way only if both the vars stay with the default value will be true, otherwise you can unarchive remote files.
This commit is contained in:
Lucas Costa Beyeler 2016-08-11 15:23:29 -03:00 committed by Matt Clay
parent 16ccde49ad
commit 6aeea1fe7e

View file

@ -733,7 +733,7 @@ def main():
file_args = module.load_file_common_arguments(module.params)
# did tar file arrive?
if not os.path.exists(src):
if not remote_src or copy:
if not remote_src and copy:
module.fail_json(msg="Source '%s' failed to transfer" % src)
# If copy=false, and src= contains ://, try and download the file to a temp directory.
elif '://' in src: