Update iosxr cliconf plugin (#43837)

* Update iosxr cliconf plugin

Fixes #39056

*  Update iosxr cliconf plugin
*  Modify iosxr module_utils code to support
   refactored cliconf plugin api's
*  Other minor changes

* Fix unit test failure

* Update ios, eos, nxos plugin for diff

* Fix review comment
This commit is contained in:
Ganesh Nalawade 2018-08-10 13:12:51 +05:30 committed by GitHub
commit d1de1e0449
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 217 additions and 153 deletions

View file

@ -366,6 +366,8 @@ def run(module, result):
running_config = get_running_config(module)
commands = None
replace_file_path = None
if match != 'none' and replace != 'config':
commands = candidate_config.difference(running_config, path=path, match=match, replace=replace)
elif replace_config:
@ -380,6 +382,7 @@ def run(module, result):
module.fail_json(msg='Copy of config file to the node failed')
commands = ['load harddisk:/ansible_config.txt']
replace_file_path = 'harddisk:/ansible_config.txt'
else:
commands = candidate_config.items
@ -399,7 +402,7 @@ def run(module, result):
commit = not check_mode
diff = load_config(
module, commands, commit=commit,
replace=replace_config, comment=comment, admin=admin,
replace=replace_file_path, comment=comment, admin=admin,
label=label
)
if diff: