Advertisement
Guest User

Untitled

a guest
May 31st, 2016
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.32 KB | None | 0 0
  1. diff --git a/lib/ansible/cli/galaxy.py b/lib/ansible/cli/galaxy.py
  2. index abc8136..10c8dc5 100644
  3. --- a/lib/ansible/cli/galaxy.py
  4. +++ b/lib/ansible/cli/galaxy.py
  5. @@ -485,22 +485,23 @@ class GalaxyCLI(CLI):
  6. else:
  7. # show all valid roles in the roles_path directory
  8. roles_path = self.get_opt('roles_path')
  9. - roles_path = os.path.expanduser(roles_path)
  10. - if not os.path.exists(roles_path):
  11. - raise AnsibleOptionsError("- the path %s does not exist. Please specify a valid path with --roles-path" % roles_path)
  12. - elif not os.path.isdir(roles_path):
  13. - raise AnsibleOptionsError("- %s exists, but it is not a directory. Please specify a valid path with --roles-path" % roles_path)
  14. - path_files = os.listdir(roles_path)
  15. - for path_file in path_files:
  16. - gr = GalaxyRole(self.galaxy, path_file)
  17. - if gr.metadata:
  18. - install_info = gr.install_info
  19. - version = None
  20. - if install_info:
  21. - version = install_info.get("version", None)
  22. - if not version:
  23. - version = "(unknown version)"
  24. - display.display("- %s, %s" % (path_file, version))
  25. + for path in roles_path:
  26. + role_path = os.path.expanduser(path)
  27. + if not os.path.exists(role_path):
  28. + raise AnsibleOptionsError("- the path %s does not exist. Please specify a valid path with --roles-path" % roles_path)
  29. + elif not os.path.isdir(role_path):
  30. + raise AnsibleOptionsError("- %s exists, but it is not a directory. Please specify a valid path with --roles-path" % roles_path)
  31. + path_files = os.listdir(role_path)
  32. + for path_file in path_files:
  33. + gr = GalaxyRole(self.galaxy, path_file)
  34. + if gr.metadata:
  35. + install_info = gr.install_info
  36. + version = None
  37. + if install_info:
  38. + version = install_info.get("version", None)
  39. + if not version:
  40. + version = "(unknown version)"
  41. + display.display("- %s, %s" % (path_file, version))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement