Commit 9e0bf168 by Michael DeHaan

Merge pull request #764 from willthames/fail_copy_on_directory

Revert acceptance of directory as dest for copy
parents bf25193e 0e26ef9b
...@@ -49,7 +49,7 @@ def main(): ...@@ -49,7 +49,7 @@ def main():
module.fail_json(msg="Destination %s not readable" % (dest)) module.fail_json(msg="Destination %s not readable" % (dest))
# Allow dest to be directory without compromising md5 check # Allow dest to be directory without compromising md5 check
if (os.path.isdir(dest)): if (os.path.isdir(dest)):
dest = os.join(dest, os.path.basename(src)) module.fail_json(msg="Destination %s cannot be a directory" % (dest))
md5sum_dest = module.md5(dest) md5sum_dest = module.md5(dest)
else: else:
if not os.access(os.path.dirname(dest), os.W_OK): if not os.access(os.path.dirname(dest), os.W_OK):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment