[stable-2.19] Short-circuit legacy network module prefix->action mapping (#85406) (#85413)

* Short-circuit legacy network module prefix->action mapping

* Modified a non-short-circuit compound conditional in a legacy networking path that attempted to resolve an action for any module name containing `_`. The bug was always present, but the typical presentation (an ImportError) was ignored prior to 2.19.
* The legacy networking path should be deprecated and removed in 2.20- a module could still be run under the wrong action if one with a matching prefix is found.

* unit test fix
(cherry picked from commit d6efb7db8a)

Co-authored-by: Matt Davis <6775756+nitzmahone@users.noreply.github.com>
This commit is contained in:
Matt Clay
2025-07-08 14:42:32 -07:00
committed by GitHub
co-authored by Matt Davis
parent da732a5c3c
commit 100b20260a
2 changed files with 2 additions and 3 deletions
+1 -2
View File
@@ -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,