Fixed bug where passing a directory as dest failed
This commit is contained in:
parent
1bb8abffa3
commit
44bfe5a7d6
1 changed files with 4 additions and 1 deletions
|
@ -348,6 +348,9 @@ def main():
|
||||||
module.fail_json(msg=e.args[0])
|
module.fail_json(msg=e.args[0])
|
||||||
|
|
||||||
prev_state = "absent"
|
prev_state = "absent"
|
||||||
|
if os.path.isdir(dest):
|
||||||
|
dest = dest + "/" + artifact_id + "-" + version + ".jar"
|
||||||
|
|
||||||
if os.path.lexists(dest):
|
if os.path.lexists(dest):
|
||||||
prev_state = "present"
|
prev_state = "present"
|
||||||
else:
|
else:
|
||||||
|
@ -359,7 +362,7 @@ def main():
|
||||||
module.exit_json(dest=dest, state=state, changed=False)
|
module.exit_json(dest=dest, state=state, changed=False)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
if downloader.download(artifact, target):
|
if downloader.download(artifact, dest):
|
||||||
module.exit_json(state=state, dest=dest, group_id=group_id, artifact_id=artifact_id, version=version, classifier=classifier, extension=extension, repository_url=repository_url, changed=True)
|
module.exit_json(state=state, dest=dest, group_id=group_id, artifact_id=artifact_id, version=version, classifier=classifier, extension=extension, repository_url=repository_url, changed=True)
|
||||||
else:
|
else:
|
||||||
module.fail_json(msg="Unable to download the artifact")
|
module.fail_json(msg="Unable to download the artifact")
|
||||||
|
|
Loading…
Add table
Reference in a new issue