Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include version_added in report.py #61857

Merged
merged 1 commit into from Sep 9, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 7 additions & 6 deletions hacking/report.py
Expand Up @@ -9,6 +9,7 @@
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__)), '..')) + '/'
Expand All @@ -22,7 +23,7 @@
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

Expand Down Expand Up @@ -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':
Expand All @@ -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']:
Expand All @@ -130,6 +130,7 @@ def populate_modules():
('namespace', 'TEXT'),
('path', 'TEXT'),
('supported_by', 'TEXT'),
('version_added', 'TEXT'),
)),
module_statuses=dict(
rows=module_statuses_rows,
Expand Down