summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Coca <bcoca@users.noreply.github.com>2022-12-15 10:06:13 -0500
committerGitHub <noreply@github.com>2022-12-15 10:06:13 -0500
commitb7e948e6230fc744af6ac3c5c6f42fa1516eeeb8 (patch)
treeab911497e19a964b50f143def881e3b8c4ffd2bb
parentf6c0e22f98e3ad1e0a98837053ed03a27d8a1fcf (diff)
downloadansible-b7e948e6230fc744af6ac3c5c6f42fa1516eeeb8.tar.gz
filter/test plugin listing, fix bug on file sorting (#79591)
* filter/test plugin listing, fix bug on file sorting avoid legacy/builtin special casing for 'all'
-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