mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-25 03:41:25 -07:00
updates action plugins for network_cli connection (#19849)
* net_config now subclasses action plugin network * net_template now subclasses action plugin network This will break existing modules until those modules have been refactored.
This commit is contained in:
parent
fdb24bb5d7
commit
630d10a27a
2 changed files with 12 additions and 24 deletions
|
@ -24,7 +24,7 @@ import re
|
|||
import time
|
||||
import glob
|
||||
|
||||
from ansible.plugins.action import ActionBase
|
||||
from ansible.plugins.action.network import ActionModule as _ActionModule
|
||||
from ansible.module_utils._text import to_text
|
||||
from ansible.module_utils.six.moves.urllib.parse import urlsplit
|
||||
|
||||
|
@ -32,13 +32,9 @@ from ansible.module_utils.six.moves.urllib.parse import urlsplit
|
|||
PRIVATE_KEYS_RE = re.compile('__.+__')
|
||||
|
||||
|
||||
class ActionModule(ActionBase):
|
||||
|
||||
TRANSFERS_FILES = False
|
||||
class ActionModule(_ActionModule):
|
||||
|
||||
def run(self, tmp=None, task_vars=None):
|
||||
result = super(ActionModule, self).run(tmp, task_vars)
|
||||
result['changed'] = False
|
||||
|
||||
if self._task.args.get('src'):
|
||||
try:
|
||||
|
@ -46,10 +42,7 @@ class ActionModule(ActionBase):
|
|||
except ValueError as exc:
|
||||
return dict(failed=True, msg=exc.message)
|
||||
|
||||
action = self._task.action
|
||||
|
||||
result.update(self._execute_module(module_name=action,
|
||||
module_args=self._task.args, task_vars=task_vars))
|
||||
result = super(ActionModule, self).run(tmp, task_vars)
|
||||
|
||||
if self._task.args.get('backup') and result.get('__backup__'):
|
||||
# User requested backup and no error occurred in module.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue