From 12cc6084656dbbeb9aac6031fa58d13d490158f2 Mon Sep 17 00:00:00 2001 From: gboutry Date: Thu, 3 Nov 2022 12:16:24 +0100 Subject: [PATCH] fix: remove collection_list when action plugin is fetch --- ansible_mitogen/strategy.py | 6 ++++-- docs/changelog.rst | 6 ++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/ansible_mitogen/strategy.py b/ansible_mitogen/strategy.py index d82e61120..25b5a7826 100644 --- a/ansible_mitogen/strategy.py +++ b/ansible_mitogen/strategy.py @@ -130,11 +130,13 @@ def wrap_action_loader__get(name, *args, **kwargs): action plugins outside the Ansible tree. """ get_kwargs = {'class_only': True} - if name in ('fetch',): - name = 'mitogen_' + name if ansible.__version__ >= '2.8': get_kwargs['collection_list'] = kwargs.pop('collection_list', None) + if name in ('fetch',): + name = 'mitogen_' + name + get_kwargs['collection_list'] = None + klass = ansible_mitogen.loaders.action_loader__get(name, **get_kwargs) if klass: bases = (ansible_mitogen.mixins.ActionModuleMixin, klass) diff --git a/docs/changelog.rst b/docs/changelog.rst index 46bd8522e..4d28ee2aa 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -17,6 +17,12 @@ Release Notes To avail of fixes in an unreleased version, please download a ZIP file `directly from GitHub `_. +v0.2.11dev0 +----------- + +* :gh:issue:`971` Fix ansible action plugin lookup when resolving fetch inside a collection + + v0.2.10 (2021-10-28) --------------------