diff options
author | Peter Sprygada <psprygada@ansible.com> | 2016-09-12 16:45:56 -0400 |
---|---|---|
committer | Peter Sprygada <psprygada@ansible.com> | 2016-09-12 16:48:47 -0400 |
commit | 0e5837a2e903c2af847be3ca8c4e9529363b3d86 (patch) | |
tree | ba266b75de1918a237482c9e7f79b77a573b7d02 /network | |
parent | 67a1bebbd36a2f6daa418b72687ea0f883165f59 (diff) | |
download | ansible-modules-extras-0e5837a2e903c2af847be3ca8c4e9529363b3d86.tar.gz |
bug fix in asa_acl module for missing candidate config
This bug was introduced accidentally when refactoring to 2.2. The instance
of the candidate config was deleted. This adds the candidate config
instance back
fixes #2890
Diffstat (limited to 'network')
-rw-r--r-- | network/asa/asa_acl.py | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/network/asa/asa_acl.py b/network/asa/asa_acl.py index 1ac0461e..80df451d 100644 --- a/network/asa/asa_acl.py +++ b/network/asa/asa_acl.py @@ -128,8 +128,10 @@ responses: type: list sample: ['...', '...'] """ +import ansible.module_utils.asa + from ansible.module_utils.netcfg import NetworkConfig -from ansible.module_utils.asa import NetworkModule +from ansible.module_utils.network import NetworkModule def get_config(module): @@ -179,16 +181,22 @@ def main(): match = module.params['match'] replace = module.params['replace'] + candidate = NetworkConfig(indent=1) + candidate.add(lines) + module.filter = check_input_acl(lines, module) + if not module.params['force']: + contents = get_config(module) + config = NetworkConfig(indent=1, contents=contents) commands = candidate.difference(config) commands = dumps(commands, 'commands').split('\n') - commands = [str(c) for c in commands if c] else: commands = str(candidate).split('\n') if commands: if not module.check_mode: + commands = [str(c) for c in commands if c] response = module.config(commands) result['responses'] = response result['changed'] = True |