Skip to content

Commit

Permalink
Do not remove local role file if given on the commandline
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
mscherer committed Sep 13, 2014
1 parent 267b3fb commit b9acacc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion bin/ansible-galaxy
Original file line number Diff line number Diff line change
Expand Up @@ -787,7 +787,8 @@ 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
os.unlink(tmp_file)
if tmp_file != role_src:
os.unlink(tmp_file)
# install dependencies, if we want them
if not no_deps and installed:
if not role_data:
Expand Down

0 comments on commit b9acacc

Please sign in to comment.