summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Coca <bcoca@users.noreply.github.com>2023-01-19 15:21:56 -0500
committerGitHub <noreply@github.com>2023-01-19 14:21:56 -0600
commitcde91027e8142cd6a6472fce1cd0485c97682056 (patch)
treea45a288942d0cbc8c91066f40e2ed63f72ff3fab
parent165557df11aa24530aaec9d16df2b45dc8cf66d9 (diff)
downloadansible-cde91027e8142cd6a6472fce1cd0485c97682056.tar.gz
filter/test plugin listing, fix bug on file sorting (#79591) (#79605)
* filter/test plugin listing, fix bug on file sorting avoid legacy/builtin special casing for 'all' (cherry picked from commit b7e948e6230fc744af6ac3c5c6f42fa1516eeeb8)
-rw-r--r--changelogs/fragments/adoc_fix_list.yml2
-rw-r--r--lib/ansible/plugins/list.py5
2 files changed, 3 insertions, 4 deletions
diff --git a/changelogs/fragments/adoc_fix_list.yml b/changelogs/fragments/adoc_fix_list.yml
new file mode 100644
index 0000000000..b0009cd02d
--- /dev/null
+++ b/changelogs/fragments/adoc_fix_list.yml
@@ -0,0 +1,2 @@
+bugfixes:
+ - ansible-doc now will correctly display short descriptions on listing filters/tests no matter the directory sorting.
diff --git a/lib/ansible/plugins/list.py b/lib/ansible/plugins/list.py
index 075225f841..e09b293fea 100644
--- a/lib/ansible/plugins/list.py
+++ b/lib/ansible/plugins/list.py
@@ -112,10 +112,7 @@ def _list_plugins_from_paths(ptype, dirs, collection, depth=0):
def _list_j2_plugins_from_file(collection, plugin_path, ptype, plugin_name):
ploader = getattr(loader, '{0}_loader'.format(ptype))
- if collection in ('ansible.builtin', 'ansible.legacy'):
- file_plugins = ploader.all()
- else:
- file_plugins = ploader.get_contained_plugins(collection, plugin_path, plugin_name)
+ file_plugins = ploader.get_contained_plugins(collection, plugin_path, plugin_name)
return file_plugins