Update eos, ios, vyos cliconf plugin (#42300)

* Update eos cliconf plugin methods

*  Refactor eos cliconf plugin
*  Changes in eos module_utils as per cliconf plugin refactor

* Fix unit test and sanity failures

* Fix review comment
This commit is contained in:
Ganesh Nalawade 2018-07-04 19:45:21 +05:30 committed by GitHub
parent 2aa81bf05d
commit c068b88b38
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 444 additions and 299 deletions

View file

@ -130,7 +130,6 @@ backup_path:
sample: /playbooks/ansible/backup/vyos_config.2016-07-16@22:28:34
"""
import re
import json
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.network.vyos.vyos import load_config, get_config, run_commands
@ -205,8 +204,7 @@ def run(module, result):
# create loadable config that includes only the configuration updates
connection = get_connection(module)
response = connection.get_diff(candidate=candidate, running=config, match=module.params['match'])
diff_obj = json.loads(response)
commands = diff_obj.get('config_diff')
commands = response.get('config_diff')
sanitize_config(commands, result)
result['commands'] = commands