From 2d4096daf0cbfeaac579a03c756f387b98047941 Mon Sep 17 00:00:00 2001 From: Aniket Khisti Date: Mon, 11 Feb 2019 23:30:00 +0530 Subject: [PATCH] Fix trackback on providing arguemnt --all to ansible-doc command (#52034) * Remove redundant argument from the function caller * Add unit test * Add changelog --- .../52034-fix-traceback-on_ansible-doc_-all.yaml | 2 ++ lib/ansible/cli/doc.py | 2 +- test/units/cli/test_doc.py | 12 ++++++++++++ 3 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/52034-fix-traceback-on_ansible-doc_-all.yaml create mode 100644 test/units/cli/test_doc.py 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()