Fix galaxy role info bug to support multiple roles (#70148)
* Add changelog fragment * Update changelog
This commit is contained in:
parent
4885ebad27
commit
dd07bdf22d
3 changed files with 12 additions and 1 deletions
2
changelogs/fragments/70148-galaxy-role-info.yaml
Normal file
2
changelogs/fragments/70148-galaxy-role-info.yaml
Normal file
|
@ -0,0 +1,2 @@
|
|||
bugfixes:
|
||||
- Fixes ``ansible-galaxy role info`` to support multiple roles on the command line (https://github.com/ansible/ansible/pull/70148)
|
|
@ -653,6 +653,8 @@ class GalaxyCLI(CLI):
|
|||
else:
|
||||
text.append(u"\t%s: %s" % (k, role_info[k]))
|
||||
|
||||
# make sure we have a trailing newline returned
|
||||
text.append(u"")
|
||||
return u'\n'.join(text)
|
||||
|
||||
@staticmethod
|
||||
|
@ -970,7 +972,7 @@ class GalaxyCLI(CLI):
|
|||
if role_spec:
|
||||
role_info.update(role_spec)
|
||||
|
||||
data = self._display_role_info(role_info)
|
||||
data += self._display_role_info(role_info)
|
||||
|
||||
self.pager(data)
|
||||
|
||||
|
|
|
@ -273,6 +273,13 @@ f_ansible_galaxy_status \
|
|||
ansible-galaxy role info -p ./testroles --offline testdesc | tee out.txt
|
||||
grep 'description: Top level' out.txt
|
||||
|
||||
# test multiple role listing
|
||||
ansible-galaxy role init otherrole --init-path ./testroles
|
||||
ansible-galaxy role info -p ./testroles --offline testdesc otherrole | tee out.txt
|
||||
grep 'Role: testdesc' out.txt
|
||||
grep 'Role: otherrole' out.txt
|
||||
|
||||
|
||||
popd # ${role_testdir}
|
||||
rm -fr "${role_testdir}"
|
||||
|
||||
|
|
Loading…
Reference in a new issue