Skip to content

Commit 06ccf9d

Browse files
committed
Always provide metadata of ansible.builtin.
1 parent aefd79c commit 06ccf9d

File tree

3 files changed

+12
-13
lines changed

3 files changed

+12
-13
lines changed

src/antsibull_docs/data/collection-enum.py

+4-5
Original file line numberDiff line numberDiff line change
@@ -249,11 +249,10 @@ def main(args):
249249
collection_name = f'{meta["namespace"]}.{meta["name"]}'
250250
if match_filter(collection_name, coll_filter):
251251
result['collections'][collection_name] = meta
252-
if match_filter('ansible.builtin', coll_filter):
253-
result['collections']['ansible.builtin'] = {
254-
'path': os.path.dirname(ansible_release.__file__),
255-
'version': ansible_release.__version__,
256-
}
252+
result['collections']['ansible.builtin'] = {
253+
'path': os.path.dirname(ansible_release.__file__),
254+
'version': ansible_release.__version__,
255+
}
257256

258257
print(json.dumps(
259258
result, cls=AnsibleJSONEncoder, sort_keys=True, indent=4 if arguments.pretty else None))

src/antsibull_docs/docs_parsing/ansible_doc.py

+5-6
Original file line numberDiff line numberDiff line change
@@ -217,12 +217,11 @@ def get_collection_metadata(venv: t.Union['VenvRunner', 'FakeVenvRunner'],
217217
) -> t.Dict[str, AnsibleCollectionMetadata]:
218218
collection_metadata = {}
219219

220-
# Obtain ansible.builtin version
221-
if collection_names is None or 'ansible.builtin' in collection_names:
222-
venv_ansible = venv.get_command('ansible')
223-
ansible_version_cmd = venv_ansible('--version', _env=env)
224-
raw_result = ansible_version_cmd.stdout.decode('utf-8', errors='surrogateescape')
225-
collection_metadata['ansible.builtin'] = _extract_ansible_builtin_metadata(raw_result)
220+
# Obtain ansible.builtin version and path
221+
venv_ansible = venv.get_command('ansible')
222+
ansible_version_cmd = venv_ansible('--version', _env=env)
223+
raw_result = ansible_version_cmd.stdout.decode('utf-8', errors='surrogateescape')
224+
collection_metadata['ansible.builtin'] = _extract_ansible_builtin_metadata(raw_result)
226225

227226
# Obtain collection versions
228227
venv_ansible_galaxy = venv.get_command('ansible-galaxy')

src/antsibull_docs/docs_parsing/parsing.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,9 @@ async def get_ansible_plugin_info(venv: t.Union['VenvRunner', 'FakeVenvRunner'],
5353
{information from ansible-doc --json. See the ansible-doc documentation
5454
for more info.}
5555
56-
The second component is a Mapping of collection names to metadata.
57-
56+
The second component is a Mapping of collection names to metadata. The second mapping
57+
always includes the metadata for ansible.builtin, even if it was not explicitly
58+
mentioned in ``collection_names``.
5859
"""
5960
flog = mlog.fields(func='get_ansible_plugin_info')
6061

0 commit comments

Comments
 (0)