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:
Peter Sprygada 2017-11-13 14:24:13 -05:00 committed by Nathaniel Case
commit b9bdb05459
4 changed files with 34 additions and 34 deletions

View file

@ -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):