mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 05:42:50 +00:00
fixes asa action plugin for connection=local (#32827)
* fixes asa action plugin for connection=local This change fixes asa modules when using connection=local to load the provider values. * fix up pep8 issues
This commit is contained in:
committed by
Nathaniel Case
parent
b70e48a54d
commit
b9bdb05459
@@ -28,7 +28,8 @@
|
||||
from ansible.module_utils._text import to_text
|
||||
from ansible.module_utils.basic import env_fallback, return_values
|
||||
from ansible.module_utils.network_common import to_list, EntityCollection
|
||||
from ansible.module_utils.connection import Connection, exec_command
|
||||
from ansible.module_utils.connection import exec_command
|
||||
from ansible.module_utils.connection import Connection, ConnectionError
|
||||
|
||||
_DEVICE_CONFIGS = {}
|
||||
_CONNECTION = None
|
||||
@@ -83,7 +84,7 @@ def get_connection(module):
|
||||
global _CONNECTION
|
||||
if _CONNECTION:
|
||||
return _CONNECTION
|
||||
_CONNECTION = Connection(module)
|
||||
_CONNECTION = Connection(module._socket_path)
|
||||
|
||||
context = module.params['context']
|
||||
|
||||
@@ -148,8 +149,11 @@ def get_config(module, flags=None):
|
||||
|
||||
|
||||
def load_config(module, config):
|
||||
conn = get_connection(module)
|
||||
conn.edit_config(config)
|
||||
try:
|
||||
conn = get_connection(module)
|
||||
conn.edit_config(config)
|
||||
except ConnectionError as exc:
|
||||
module.fail_json(msg=to_text(exc))
|
||||
|
||||
|
||||
def get_defaults_flag(module):
|
||||
|
||||
Reference in New Issue
Block a user