Skip to content

Commit

Permalink
Fix antsibull-docs error if unexpected plugin type is documented (#404)
Browse files Browse the repository at this point in the history
* Fix anstibull error if expected diff plugin list

* F it

* clog

* Update changelogs/fragments/404_not_found.yml

Co-authored-by: Felix Fontein <felix@fontein.de>
  • Loading branch information
bcoca and felixfontein authored Feb 22, 2022
1 parent 9f098d9 commit 0b4df84
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
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-docs will no longer traceback when it tries to process plugins not found in its own constant but are available in ansible-core (https://github.com/ansible-community/antsibull/pull/404).
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

0 comments on commit 0b4df84

Please sign in to comment.