From 996281d7480ea700cec9f78b67503f6d3d1f7f09 Mon Sep 17 00:00:00 2001 From: Toshio Kuratomi Date: Mon, 3 Jul 2017 23:37:59 -0700 Subject: [PATCH] Remove metadata from docstring parsing as per last week's meeting decision --- lib/ansible/utils/plugin_docs.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/lib/ansible/utils/plugin_docs.py b/lib/ansible/utils/plugin_docs.py index e93d08856a..f59f115401 100644 --- a/lib/ansible/utils/plugin_docs.py +++ b/lib/ansible/utils/plugin_docs.py @@ -103,6 +103,17 @@ def get_docstring(filename, verbose=False): directory. """ + # FIXME: Should refactor this so that we have a docstring parsing + # function and a separate variable parsing function + # Can have a function one higher that invokes whichever is needed + # + # Should look roughly like this: + # get_plugin_doc(filename, verbose=False) + # documentation = extract_docstring(plugin_ast, identifier, verbose=False) + # if not documentation and not (filter or test): + # documentation = extract_variables(plugin_ast) + # documentation['metadata'] = extract_metadata(plugin_ast) + data = { 'doc': None, 'plainexamples': None, @@ -114,7 +125,6 @@ def get_docstring(filename, verbose=False): 'DOCUMENTATION': 'doc', 'EXAMPLES': 'plainexamples', 'RETURN': 'returndocs', - 'ANSIBLE_METADATA': 'metadata' } try: @@ -155,7 +165,9 @@ def get_docstring(filename, verbose=False): data[varkey] = child.value.s display.debug('assigned :%s' % varkey) + # Metadata is per-file rather than per-plugin/function data['metadata'] = extract_metadata(module_ast=M)[0] + # add fragments to documentation if data['doc']: add_fragments(data['doc'], filename)