Commit f52624f6 by Stephen Fromm

Give nice error message if destination directory doesn't exist (issue #1048)

parent f8a95414
......@@ -56,6 +56,8 @@ def main():
module.fail_json(msg="Destination %s cannot be a directory" % (dest))
md5sum_dest = module.md5(dest)
else:
if not os.path.exists(os.path.dirname(dest)):
module.fail_json(msg="Destination directory %s does not exist" % (os.path.dirname(dest)))
if not os.access(os.path.dirname(dest), os.W_OK):
module.fail_json(msg="Destination %s not writable" % (os.path.dirname(dest)))
......
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