summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWill Thames <willdthames@gmail.com>2012-08-02 16:02:15 +1000
committerWill Thames <willdthames@gmail.com>2012-08-02 16:54:03 +1000
commit0e26ef9bddcf763ad748447dffa6ee7cb464734c (patch)
treed7561b88dfa4f91bb501815a0d3c7a2f1eb97188
parentbf25193ec171533edee6c4098d9f8e2be056d199 (diff)
downloadansible-0e26ef9bddcf763ad748447dffa6ee7cb464734c.tar.gz
Revert acceptance of directory as dest for copy
Although library/copy can be corrected to understand that dest is a directory, I can't see how to let _execute_copy know this and let the file module know. As a better solution than before #733, the copy module now explicitly (rather than silently) fails when dest is a directory.
-rwxr-xr-xlibrary/copy2
1 files changed, 1 insertions, 1 deletions
diff --git a/library/copy b/library/copy
index 7284a12abf..b0c24bb312 100755
--- a/library/copy
+++ b/library/copy
@@ -49,7 +49,7 @@ def main():
module.fail_json(msg="Destination %s not readable" % (dest))
# Allow dest to be directory without compromising md5 check
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)
else:
if not os.access(os.path.dirname(dest), os.W_OK):