1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Do not remove local role file if given on the commandline

using this (for testing purpose) :
  $ ansible-galaxy install COPYING
  - error: the file downloaded was not a tar.gz
  - COPYING was NOT installed successfully.
  - you can use --ignore-errors to skip failed roles.

this result in COPYING being erased, which is surprising for the user.
This also prevent erasing requirements.yml if someone use the wrong flag.
This commit is contained in:
Michael Scherer 2014-09-13 12:27:47 +02:00
parent 267b3fb7b7
commit b9acaccc1d

View file

@ -787,6 +787,7 @@ def execute_install(args, options, parser):
if tmp_file:
installed = install_role(role.get("name"), role.get("version"), tmp_file, options)
# we're done with the temp file, clean it up
if tmp_file != role_src:
os.unlink(tmp_file)
# install dependencies, if we want them
if not no_deps and installed: