diff options
author | James Cammarata <jimi@sngx.net> | 2014-09-05 19:46:33 +0200 |
---|---|---|
committer | James Cammarata <jimi@sngx.net> | 2014-09-05 19:53:49 +0200 |
commit | f14dba8b2fbd8a5baa3f4801593b239a7074bce6 (patch) | |
tree | cebeeb311afecb49461135e491cfb1b8b2ab1370 | |
parent | Reduce commenting as basic.py is copied to the remote host with every module ... (diff) | |
download | ansible-f14dba8b2fbd8a5baa3f4801593b239a7074bce6.tar.xz ansible-f14dba8b2fbd8a5baa3f4801593b239a7074bce6.zip |
Don't re-add galaxy deps if they've already been added for install
Fixes #8890
-rwxr-xr-x | bin/ansible-galaxy | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/bin/ansible-galaxy b/bin/ansible-galaxy index 5b1b815133..075fbd6a6f 100755 --- a/bin/ansible-galaxy +++ b/bin/ansible-galaxy @@ -780,7 +780,7 @@ def execute_install(args, options, parser): # we're done with the temp file, clean it up os.unlink(tmp_file) # install dependencies, if we want them - if not no_deps: + if not no_deps and installed: if not role_data: role_data = get_role_metadata(role.get("name"), options) role_dependencies = role_data['dependencies'] @@ -792,12 +792,15 @@ def execute_install(args, options, parser): else: dep = ansible.utils.role_yaml_parse(dep) if not get_role_metadata(dep["name"], options): - print '- adding dependency: %s' % dep["name"] - roles_left.append(dep) + if dep not in roles_left: + print '- adding dependency: %s' % dep["name"] + roles_left.append(dep) + else: + print '- dependency %s already pending installation.' % dep["name"] else: print '- dependency %s is already installed, skipping.' % dep["name"] if not tmp_file or not installed: - if tmp_file: + if tmp_file and installed: os.unlink(tmp_file) print "- %s was NOT installed successfully." % role.get("name") exit_without_ignore(options) |