summaryrefslogtreecommitdiff
path: root/bin/ansible-galaxy
diff options
context:
space:
mode:
authorMichael Scherer <misc@zarb.org>2014-09-13 12:27:47 +0200
committerMichael Scherer <misc@zarb.org>2014-09-13 12:31:56 +0200
commitb9acaccc1d59a4efb70903fc3aa3e00a6c62749b (patch)
treefa5f85114cb7a566e60b564eb4f06b798650e582 /bin/ansible-galaxy
parent267b3fb7b74d6b9dfb1f736ae55558de83fa951e (diff)
downloadansible-b9acaccc1d59a4efb70903fc3aa3e00a6c62749b.tar.gz
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.
Diffstat (limited to 'bin/ansible-galaxy')
-rwxr-xr-xbin/ansible-galaxy3
1 files changed, 2 insertions, 1 deletions
diff --git a/bin/ansible-galaxy b/bin/ansible-galaxy
index 146361da93..81be7b111a 100755
--- a/bin/ansible-galaxy
+++ b/bin/ansible-galaxy
@@ -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: