From 99746d4a8393bc3b0f4af71950837e30e73985a1 Mon Sep 17 00:00:00 2001 From: Ali Asad Lotia Date: Fri, 14 Sep 2012 08:02:30 +0100 Subject: [PATCH] Indicate thirsty argument required if dest is dir. The check for the destination being a directory is now done before checking if the file exists, that way the user is informed that the thirsty argument is required. --- library/get_url | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/library/get_url b/library/get_url index f557b29ab9..cb848f8683 100755 --- a/library/get_url +++ b/library/get_url @@ -145,11 +145,10 @@ def main(): thirsty = module.boolean(module.params['thirsty']) if not thirsty: - if os.path.exists(dest): - module.exit_json(msg="file already exists", changed=False) if os.path.isdir(dest): module.fail_json(msg="non-thirsty mode needs a filename for a destination, not a directory") - + if os.path.exists(dest): + module.exit_json(msg="file already exists", changed=False) # download to tmpsrc tmpsrc, info = url_get(module, url, dest)