Bug fix for #53271 (return commands for cli_config) (#61808)

* cli_config return commands bug fix

* Spacing error

* Added notes section

* Spacing error

* Spacing error

* Spacing error

* Spacing error
This commit is contained in:
Adharsh Srivats R 2020-01-14 11:32:28 -05:00 committed by ansibot
parent 9272e3d547
commit 6044325dec

View file

@ -18,6 +18,9 @@ DOCUMENTATION = """
module: cli_config
version_added: "2.7"
author: "Trishna Guha (@trishnaguha)"
notes:
- The commands will be returned only for platforms that do not support onbox diff.
The C(--diff) option with the playbook will return the difference in configuration for devices that has support for onbox diff
short_description: Push text based configuration to network devices over network_cli
description:
- This module provides platform agnostic way of pushing text based
@ -297,11 +300,16 @@ def run(module, device_operations, connection, candidate, running, rollback_id):
else:
candidate = config_diff.splitlines()
kwargs = {'candidate': candidate, 'commit': commit, 'replace': replace,
'comment': commit_comment}
kwargs = {
'candidate': candidate,
'commit': commit,
'replace': replace,
'comment': commit_comment
}
if commit:
connection.edit_config(**kwargs)
result['changed'] = True
result['commands'] = config_diff.split('\n')
if banner_diff:
candidate = json.dumps(banner_diff)