diff --git a/lib/ansible/executor/task_executor.py b/lib/ansible/executor/task_executor.py index 1809b1252f1..60c6b392cbc 100644 --- a/lib/ansible/executor/task_executor.py +++ b/lib/ansible/executor/task_executor.py @@ -1129,7 +1129,7 @@ class TaskExecutor: # let action plugin override module, fallback to 'normal' action plugin otherwise elif self._shared_loader_obj.action_loader.has_plugin(self._task.action, collection_list=collections): handler_name = self._task.action - elif all((module_prefix in C.NETWORK_GROUP_MODULES, self._shared_loader_obj.action_loader.has_plugin(network_action, collection_list=collections))): + elif module_prefix in C.NETWORK_GROUP_MODULES and self._shared_loader_obj.action_loader.has_plugin(network_action, collection_list=collections): handler_name = network_action display.vvvv("Using network group action {handler} for {action}".format(handler=handler_name, action=self._task.action), diff --git a/test/units/executor/test_task_executor.py b/test/units/executor/test_task_executor.py index ba919baa28f..695230b93e9 100644 --- a/test/units/executor/test_task_executor.py +++ b/test/units/executor/test_task_executor.py @@ -273,8 +273,7 @@ class TestTaskExecutor(unittest.TestCase): self.assertIs(mock.sentinel.handler, handler) - action_loader.has_plugin.assert_has_calls([mock.call(action, collection_list=te._task.collections), - mock.call(module_prefix, collection_list=te._task.collections)]) + action_loader.has_plugin.assert_has_calls([mock.call(action, collection_list=te._task.collections)]) action_loader.get.assert_called_with( 'ansible.legacy.normal', task=te._task, connection=te._connection,