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

Fix antsibull-docs error if unexpected plugin type is documented #404

Merged
merged 4 commits into from
Feb 22, 2022
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions changelogs/fragments/404_not_found.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bugfixes:
- anstibull will not traceback anymore when it tries to process plugins not found in it's own constant but are available in ansible.
felixfontein marked this conversation as resolved.
Show resolved Hide resolved
5 changes: 5 additions & 0 deletions src/antsibull/docs_parsing/ansible_internal.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import tempfile
import typing as t

from ..constants import DOCUMENTABLE_PLUGINS
from ..logging import log
from ..utils.get_pkg_data import get_antsibull_data
from ..vendored.json_utils import _filter_non_json_lines
Expand Down Expand Up @@ -65,6 +66,10 @@ async def get_ansible_plugin_info(venv: t.Union['VenvRunner', 'FakeVenvRunner'],

plugin_map = {}
for plugin_type, plugins in result['plugins'].items():
if plugin_type not in DOCUMENTABLE_PLUGINS:
# avoid keyerrors down the line when we cannot match types
flog.debug(f'Skipping unknown plugin type: {plugin_type}')
continue
plugin_map[plugin_type] = {}
for plugin_name, plugin_data in plugins.items():
if '.' not in plugin_name:
Expand Down