Allow check_mode with supports_generate_diff capability in cli_config (#51384)
* If network cliconf support `supports_generate_diff` in that case diff between running and cnadidate config is generated within Ansible and if check_mode is enabled in that case return only diff without actually invoking edit_config()
This commit is contained in:
parent
f712e86728
commit
8f5cd049d6
1 changed files with 4 additions and 2 deletions
|
@ -286,6 +286,7 @@ def run(module, device_operations, connection, candidate, running, rollback_id):
|
||||||
|
|
||||||
kwargs = {'candidate': candidate, 'commit': commit, 'replace': replace,
|
kwargs = {'candidate': candidate, 'commit': commit, 'replace': replace,
|
||||||
'comment': commit_comment}
|
'comment': commit_comment}
|
||||||
|
if commit:
|
||||||
connection.edit_config(**kwargs)
|
connection.edit_config(**kwargs)
|
||||||
result['changed'] = True
|
result['changed'] = True
|
||||||
|
|
||||||
|
@ -295,6 +296,7 @@ def run(module, device_operations, connection, candidate, running, rollback_id):
|
||||||
kwargs = {'candidate': candidate, 'commit': commit}
|
kwargs = {'candidate': candidate, 'commit': commit}
|
||||||
if multiline_delimiter:
|
if multiline_delimiter:
|
||||||
kwargs.update({'multiline_delimiter': multiline_delimiter})
|
kwargs.update({'multiline_delimiter': multiline_delimiter})
|
||||||
|
if commit:
|
||||||
connection.edit_banner(**kwargs)
|
connection.edit_banner(**kwargs)
|
||||||
result['changed'] = True
|
result['changed'] = True
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue