Fix junos modules persistent connection check (#57986)

Fixes #57985

*  The check `USE_PERSISTENT_CONNECTION` flag is no longer
   required in action plugin as the junos modules in galaxy are renamed
   to start with `juniper_`.
This commit is contained in:
Ganesh Nalawade 2019-06-24 19:24:20 +05:30 committed by GitHub
parent 278c59b17e
commit 67c251d13c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -22,12 +22,10 @@ __metaclass__ = type
import sys
import copy
from ansible import constants as C
from ansible.module_utils._text import to_text
from ansible.module_utils.connection import Connection
from ansible.module_utils.network.common.utils import load_provider
from ansible.module_utils.network.junos.junos import junos_provider_spec
from ansible.plugins.loader import connection_loader, module_loader
from ansible.plugins.action.network import ActionModule as ActionNetworkModule
from ansible.utils.display import Display
@ -42,10 +40,6 @@ class ActionModule(ActionNetworkModule):
del tmp # tmp no longer has any effect
self._config_module = True if self._task.action == 'junos_config' else False
module = module_loader._load_module_source(self._task.action, module_loader.find_plugin(self._task.action))
if not getattr(module, 'USE_PERSISTENT_CONNECTION', False):
return super(ActionModule, self).run(task_vars=task_vars)
socket_path = None
if self._play_context.connection == 'local':