mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
implemented galaxy list in v2
This commit is contained in:
parent
9abd9a8f57
commit
7215470c6f
1 changed files with 5 additions and 3 deletions
|
@ -452,7 +452,8 @@ class GalaxyCLI(CLI):
|
|||
|
||||
if len(self.args) == 1:
|
||||
# show only the request role, if it exists
|
||||
gr = GalaxyRole(self.galaxy, self.name)
|
||||
name = self.args.pop()
|
||||
gr = GalaxyRole(self.galaxy, name)
|
||||
if gr.metadata:
|
||||
install_info = gr.install_info
|
||||
version = None
|
||||
|
@ -461,9 +462,9 @@ class GalaxyCLI(CLI):
|
|||
if not version:
|
||||
version = "(unknown version)"
|
||||
# show some more info about single roles here
|
||||
self.display.display("- %s, %s" % (self.name, version))
|
||||
self.display.display("- %s, %s" % (name, version))
|
||||
else:
|
||||
self.display.display("- the role %s was not found" % self.name)
|
||||
self.display.display("- the role %s was not found" % name)
|
||||
else:
|
||||
# show all valid roles in the roles_path directory
|
||||
roles_path = self.get_opt('roles_path')
|
||||
|
@ -474,6 +475,7 @@ class GalaxyCLI(CLI):
|
|||
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.metadata
|
||||
version = None
|
||||
|
|
Loading…
Reference in a new issue