From c5484e845aa84ac87591be8bafa91d5ce0e0f4c8 Mon Sep 17 00:00:00 2001 From: Matt Davis Date: Wed, 6 Jun 2018 10:18:53 -0700 Subject: [PATCH] fix ansible-doc regression from missing plugins (#41167) (cherry picked from commit 087efe4232d6134851423f592c797d7ff36ab200) --- changelogs/fragments/41167_ansible_doc_regression.yaml | 2 ++ lib/ansible/cli/doc.py | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/41167_ansible_doc_regression.yaml 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)