summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Coca <brian.coca+git@gmail.com>2016-05-31 09:00:06 -0400
committerBrian Coca <brian.coca+git@gmail.com>2016-05-31 09:00:56 -0400
commiteaa7b9c0b70fe022bb2ba4b6d82b02445efa20ba (patch)
treea8c21ab5001dd2306c0507fc97eb18c33974d1d8
parent018d3c3118eb4a1572e81f7637cb09d656edb6b0 (diff)
downloadansible-eaa7b9c0b70fe022bb2ba4b6d82b02445efa20ba.tar.gz
treat roles_path as the list it is for galaxy list
-rw-r--r--lib/ansible/cli/galaxy.py33
1 files changed, 17 insertions, 16 deletions
diff --git a/lib/ansible/cli/galaxy.py b/lib/ansible/cli/galaxy.py
index abc8136243..10c8dc5b46 100644
--- a/lib/ansible/cli/galaxy.py
+++ b/lib/ansible/cli/galaxy.py
@@ -485,22 +485,23 @@ class GalaxyCLI(CLI):
else:
# show all valid roles in the roles_path directory
roles_path = self.get_opt('roles_path')
- roles_path = os.path.expanduser(roles_path)
- if not os.path.exists(roles_path):
- raise AnsibleOptionsError("- the path %s does not exist. Please specify a valid path with --roles-path" % roles_path)
- elif not os.path.isdir(roles_path):
- raise AnsibleOptionsError("- %s exists, but it is not a directory. Please specify a valid path with --roles-path" % roles_path)
- path_files = os.listdir(roles_path)
- for path_file in path_files:
- gr = GalaxyRole(self.galaxy, path_file)
- if gr.metadata:
- install_info = gr.install_info
- version = None
- if install_info:
- version = install_info.get("version", None)
- if not version:
- version = "(unknown version)"
- display.display("- %s, %s" % (path_file, version))
+ for path in roles_path:
+ role_path = os.path.expanduser(path)
+ if not os.path.exists(role_path):
+ raise AnsibleOptionsError("- the path %s does not exist. Please specify a valid path with --roles-path" % roles_path)
+ elif not os.path.isdir(role_path):
+ raise AnsibleOptionsError("- %s exists, but it is not a directory. Please specify a valid path with --roles-path" % roles_path)
+ path_files = os.listdir(role_path)
+ for path_file in path_files:
+ gr = GalaxyRole(self.galaxy, path_file)
+ if gr.metadata:
+ install_info = gr.install_info
+ version = None
+ if install_info:
+ version = install_info.get("version", None)
+ if not version:
+ version = "(unknown version)"
+ display.display("- %s, %s" % (path_file, version))
return 0
def execute_search(self):