From b7e948e6230fc744af6ac3c5c6f42fa1516eeeb8 Mon Sep 17 00:00:00 2001 From: Brian Coca Date: Thu, 15 Dec 2022 10:06:13 -0500 Subject: [PATCH] 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' --- changelogs/fragments/adoc_fix_list.yml | 2 ++ lib/ansible/plugins/list.py | 5 +---- 2 files changed, 3 insertions(+), 4 deletions(-) create mode 100644 changelogs/fragments/adoc_fix_list.yml diff --git a/changelogs/fragments/adoc_fix_list.yml b/changelogs/fragments/adoc_fix_list.yml new file mode 100644 index 00000000000..b0009cd02d1 --- /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 075225f8410..e09b293feaf 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