diff --git a/library/copy b/library/copy index 7284a12abf0..b0c24bb3125 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):