diff --git a/changelogs/fragments/52034-fix-traceback-on_ansible-doc_-all.yaml b/changelogs/fragments/52034-fix-traceback-on_ansible-doc_-all.yaml new file mode 100644 index 00000000000..e50d51e4f2a --- /dev/null +++ b/changelogs/fragments/52034-fix-traceback-on_ansible-doc_-all.yaml @@ -0,0 +1,2 @@ +bugfixes: + - ansible-doc - Fix traceback on providing arguemnt --all to ansible-doc command diff --git a/lib/ansible/cli/doc.py b/lib/ansible/cli/doc.py index f9babca60ef..e9ecfc1df7c 100644 --- a/lib/ansible/cli/doc.py +++ b/lib/ansible/cli/doc.py @@ -117,7 +117,7 @@ class DocCLI(CLI): # process all plugins of type if self.options.all_plugins: - self.args = self.get_all_plugins_of_type(plugin_type, loader) + self.args = self.get_all_plugins_of_type(plugin_type) # dump plugin metadata as JSON if self.options.json_dump: diff --git a/test/units/cli/test_doc.py b/test/units/cli/test_doc.py new file mode 100644 index 00000000000..eb117dc56d9 --- /dev/null +++ b/test/units/cli/test_doc.py @@ -0,0 +1,12 @@ +# Copyright: (c) 2019, Ansible Project +# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type + +from ansible.cli.doc import DocCLI + + +def test_parsing_all_option(): + doc_cli = DocCLI(['/n/ansible-doc', '-a']) + doc_cli.parse()