diff options
author | Matt Martz <matt@sivel.net> | 2019-09-09 18:40:38 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-09 18:40:38 +0200 |
commit | 4e2c70c13e710a9c3c1ce29f3c269449002d8ab3 (patch) | |
tree | 8e07e3cc573f13d2db3780d185301d23e0a312e9 | |
parent | VMware: not ssl.SSLContext if validate_certs false (#57185) (diff) | |
download | ansible-4e2c70c13e710a9c3c1ce29f3c269449002d8ab3.tar.xz ansible-4e2c70c13e710a9c3c1ce29f3c269449002d8ab3.zip |
Include version_added in report.py (#61857)
-rwxr-xr-x | hacking/report.py | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/hacking/report.py b/hacking/report.py index ae4b3fb96d..9c5d52d6dd 100755 --- a/hacking/report.py +++ b/hacking/report.py @@ -9,6 +9,7 @@ import json import os import sqlite3 import sys +import yaml DATABASE_PATH = os.path.expanduser('~/.ansible/report.db') BASE_PATH = os.path.abspath(os.path.join(os.path.dirname(os.path.abspath(__file__)), '..')) + '/' @@ -22,7 +23,7 @@ if ANSIBLE_TEST_PATH not in sys.path: sys.path.insert(0, ANSIBLE_TEST_PATH) from ansible.module_utils.urls import open_url -from ansible.parsing.metadata import extract_metadata +from ansible.parsing.plugin_docs import read_docstring from ansible_test._internal.target import walk_integration_targets @@ -96,12 +97,10 @@ def populate_modules(): path = os.path.join(root, file_name) - with open(path, 'rb') as module_fd: - module_data = module_fd.read() + result = read_docstring(path) - result = extract_metadata(module_data=module_data) - - metadata = result[0] + metadata = result['metadata'] + doc = result['doc'] if not metadata: if module == 'async_wrapper': @@ -114,6 +113,7 @@ def populate_modules(): namespace=namespace, path=path.replace(BASE_PATH, ''), supported_by=metadata['supported_by'], + version_added=str(doc.get('version_added', '')) if doc else '', )) for status in metadata['status']: @@ -130,6 +130,7 @@ def populate_modules(): ('namespace', 'TEXT'), ('path', 'TEXT'), ('supported_by', 'TEXT'), + ('version_added', 'TEXT'), )), module_statuses=dict( rows=module_statuses_rows, |