mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-23 13:20:23 -07:00
moved network module magic from hardcoded to conf
This commit is contained in:
parent
2d9bf88897
commit
7ad6ce7ea1
3 changed files with 7 additions and 2 deletions
|
@ -774,13 +774,12 @@ class TaskExecutor:
|
|||
Returns the correct action plugin to handle the requestion task action
|
||||
'''
|
||||
|
||||
network_group_modules = frozenset(['eos', 'nxos', 'ios', 'iosxr', 'junos', 'vyos'])
|
||||
module_prefix = self._task.action.split('_')[0]
|
||||
|
||||
# let action plugin override module, fallback to 'normal' action plugin otherwise
|
||||
if self._task.action in self._shared_loader_obj.action_loader:
|
||||
handler_name = self._task.action
|
||||
elif all((module_prefix in network_group_modules, module_prefix in self._shared_loader_obj.action_loader)):
|
||||
elif all((module_prefix in C.NETWORK_GROUP_MODULES, module_prefix in self._shared_loader_obj.action_loader)):
|
||||
handler_name = module_prefix
|
||||
else:
|
||||
handler_name = 'normal'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue