Fix role list regression (#67436)

Add the roles_path parent to the role_parser
object, so paths are passed to the list function

Add basic role list tests to prevent future regressions
pull/67437/head
Sam Doran 4 years ago committed by GitHub
parent 5ea26b6e5a
commit 7ae34cef15
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -0,0 +1,2 @@
bugfixes:
- ansible-galaxy - fix regression that prenented roles from being listed

@ -176,7 +176,7 @@ class GalaxyCLI(CLI):
self.add_init_options(role_parser, parents=[common, force, offline])
self.add_remove_options(role_parser, parents=[common, roles_path])
self.add_delete_options(role_parser, parents=[common, github])
self.add_list_options(role_parser, parents=[common])
self.add_list_options(role_parser, parents=[common, roles_path])
self.add_search_options(role_parser, parents=[common])
self.add_import_options(role_parser, parents=[common, github])
self.add_setup_options(role_parser, parents=[common, roles_path])

@ -107,6 +107,20 @@ EOF
popd # ${galaxy_testdir}
rm -fr "${galaxy_testdir}"
# Galaxy role list test case
#
# Basic tests to ensure listing roles works
f_ansible_galaxy_status \
"role list"
ansible-galaxy role list | tee out.txt
ansible-galaxy role list test-role | tee -a out.txt
[[ $(grep -c '^- test-role' out.txt ) -eq 2 ]]
#################################
# ansible-galaxy collection tests
#################################

Loading…
Cancel
Save