treat roles_path as the list it is for galaxy list

This commit is contained in:
Brian Coca 2016-05-31 09:00:06 -04:00
parent 2452bd2135
commit a59478f4f4

View file

@ -485,12 +485,13 @@ class GalaxyCLI(CLI):
else: else:
# show all valid roles in the roles_path directory # show all valid roles in the roles_path directory
roles_path = self.get_opt('roles_path') roles_path = self.get_opt('roles_path')
roles_path = os.path.expanduser(roles_path) for path in roles_path:
if not os.path.exists(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) 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): 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) 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) path_files = os.listdir(role_path)
for path_file in path_files: for path_file in path_files:
gr = GalaxyRole(self.galaxy, path_file) gr = GalaxyRole(self.galaxy, path_file)
if gr.metadata: if gr.metadata: