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
This commit is contained in:
parent
5ea26b6e5a
commit
7ae34cef15
3 changed files with 17 additions and 1 deletions
2
changelogs/fragments/galaxy-role-list-fix.yml
Normal file
2
changelogs/fragments/galaxy-role-list-fix.yml
Normal file
|
@ -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_init_options(role_parser, parents=[common, force, offline])
|
||||||
self.add_remove_options(role_parser, parents=[common, roles_path])
|
self.add_remove_options(role_parser, parents=[common, roles_path])
|
||||||
self.add_delete_options(role_parser, parents=[common, github])
|
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_search_options(role_parser, parents=[common])
|
||||||
self.add_import_options(role_parser, parents=[common, github])
|
self.add_import_options(role_parser, parents=[common, github])
|
||||||
self.add_setup_options(role_parser, parents=[common, roles_path])
|
self.add_setup_options(role_parser, parents=[common, roles_path])
|
||||||
|
|
|
@ -107,6 +107,20 @@ EOF
|
||||||
popd # ${galaxy_testdir}
|
popd # ${galaxy_testdir}
|
||||||
rm -fr "${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
|
# ansible-galaxy collection tests
|
||||||
#################################
|
#################################
|
||||||
|
|
Loading…
Reference in a new issue