mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Merge pull request #1047 from lotia/get_url_require_thirsty_if_dest_is_dir
Make get_url module always return dest.
This commit is contained in:
commit
70777f044d
1 changed files with 2 additions and 3 deletions
|
@ -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", dest=dest, url=url, changed=False)
|
||||
|
||||
# download to tmpsrc
|
||||
tmpsrc, info = url_get(module, url, dest)
|
||||
|
|
Loading…
Reference in a new issue