From dd906e20f43c4c7de43109aa53c4f5cfe3f73ed8 Mon Sep 17 00:00:00 2001 From: Toshio Kuratomi Date: Thu, 25 Oct 2018 11:22:44 -0700 Subject: [PATCH] Set the default metadata --- lib/ansible/parsing/plugin_docs.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/ansible/parsing/plugin_docs.py b/lib/ansible/parsing/plugin_docs.py index fe0057f8a7..1f0dbbac17 100644 --- a/lib/ansible/parsing/plugin_docs.py +++ b/lib/ansible/parsing/plugin_docs.py @@ -68,11 +68,15 @@ def read_docstring(filename, verbose=True, ignore_errors=True): # Metadata is per-file and a dict rather than per-plugin/function and yaml data['metadata'] = extract_metadata(module_ast=M)[0] - # remove version if data['metadata']: + # remove version for x in ('version', 'metadata_version'): if x in data['metadata']: del data['metadata'][x] + else: + # Add default metadata + data['metadata'] = {'supported_by': 'community', + 'status': ['preview']} except: if verbose: display.error("unable to parse %s" % filename)