diff --git a/changelogs/fragments/41167_ansible_doc_regression.yaml b/changelogs/fragments/41167_ansible_doc_regression.yaml new file mode 100644 index 00000000000..c177c111064 --- /dev/null +++ b/changelogs/fragments/41167_ansible_doc_regression.yaml @@ -0,0 +1,2 @@ +bugfixes: +- ansible-doc - fixed traceback on missing plugins (https://github.com/ansible/ansible/pull/41167) diff --git a/lib/ansible/cli/doc.py b/lib/ansible/cli/doc.py index cc69f2981f6..4b4aa3507a5 100644 --- a/lib/ansible/cli/doc.py +++ b/lib/ansible/cli/doc.py @@ -156,7 +156,10 @@ class DocCLI(CLI): # process command line list text = '' for plugin in self.args: - text += self.format_plugin_doc(plugin, loader, plugin_type, search_paths) + textret = self.format_plugin_doc(plugin, loader, plugin_type, search_paths) + + if textret: + text += textret if text: self.pager(text)