Fix galaxy role info bug to support multiple roles (#70148)

* Add changelog fragment
* Update changelog
This commit is contained in:
David Shrewsbury 2020-06-23 16:57:25 -04:00 committed by GitHub
parent 4885ebad27
commit dd07bdf22d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 1 deletions

View 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)

View file

@ -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)

View file

@ -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}"