From ae0c1bbc470cdf9312a1b2fbaeed834dafb21be4 Mon Sep 17 00:00:00 2001 From: Brian Coca Date: Thu, 14 Jul 2016 15:50:14 -0400 Subject: [PATCH] ansible-doc now notes when module has action plugin --- lib/ansible/cli/doc.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/lib/ansible/cli/doc.py b/lib/ansible/cli/doc.py index 5a699f8a97..1f989646dc 100644 --- a/lib/ansible/cli/doc.py +++ b/lib/ansible/cli/doc.py @@ -28,7 +28,7 @@ from ansible.compat.six import iteritems from ansible import constants as C from ansible.errors import AnsibleError, AnsibleOptionsError -from ansible.plugins import module_loader +from ansible.plugins import module_loader, action_loader from ansible.cli import CLI from ansible.utils import module_docs @@ -106,6 +106,12 @@ class DocCLI(CLI): if doc is not None: + # is there corresponding action plugin? + if module in action_loader: + doc['action'] = True + else: + doc['action'] = False + all_keys = [] for (k,v) in iteritems(doc['options']): all_keys.append(k) @@ -249,6 +255,9 @@ class DocCLI(CLI): if 'deprecated' in doc and doc['deprecated'] is not None and len(doc['deprecated']) > 0: text.append("DEPRECATED: \n%s\n" % doc['deprecated']) + if 'action' in doc and doc['action']: + text.append(" * note: %s\n" % "This module has a corresponding action plugin.") + if 'option_keys' in doc and len(doc['option_keys']) > 0: text.append("Options (= is mandatory):\n")