mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-26 20:31:27 -07:00
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:
parent
2aa81bf05d
commit
c068b88b38
14 changed files with 444 additions and 299 deletions
|
@ -400,6 +400,7 @@ def main():
|
|||
check_args(module, warnings)
|
||||
result['warnings'] = warnings
|
||||
|
||||
diff_ignore_lines = module.params['diff_ignore_lines']
|
||||
config = None
|
||||
contents = None
|
||||
flags = get_defaults_flag(module) if module.params['defaults'] else []
|
||||
|
@ -419,10 +420,9 @@ def main():
|
|||
candidate = get_candidate_config(module)
|
||||
running = get_running_config(module, contents, flags=flags)
|
||||
|
||||
response = connection.get_diff(candidate=candidate, running=running, match=match, diff_ignore_lines=None, path=path, replace=replace)
|
||||
diff = json.loads(response)
|
||||
config_diff = diff['config_diff']
|
||||
banner_diff = diff['banner_diff']
|
||||
response = connection.get_diff(candidate=candidate, running=running, match=match, diff_ignore_lines=diff_ignore_lines, path=path, replace=replace)
|
||||
config_diff = response['config_diff']
|
||||
banner_diff = response['banner_diff']
|
||||
|
||||
if config_diff or banner_diff:
|
||||
commands = config_diff.split('\n')
|
||||
|
@ -450,8 +450,6 @@ def main():
|
|||
running_config = module.params['running_config']
|
||||
startup_config = None
|
||||
|
||||
diff_ignore_lines = module.params['diff_ignore_lines']
|
||||
|
||||
if module.params['save_when'] == 'always' or module.params['save']:
|
||||
save_config(module, result)
|
||||
elif module.params['save_when'] == 'modified':
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue