mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-26 12:21:26 -07:00
code cleanup for --diff
and --check
modes (#33665)
* code cleanup for `--diff` and `--check` modes * fixes UT to remove exec_command
This commit is contained in:
parent
4d67cdd1f7
commit
012a96dabd
9 changed files with 68 additions and 55 deletions
|
@ -242,8 +242,10 @@ def main():
|
|||
result['commands'] = commands
|
||||
|
||||
if commands:
|
||||
if not module.check_mode:
|
||||
load_config(module, commands, result['warnings'], commit=True)
|
||||
commit = not module.check_mode
|
||||
diff = load_config(module, commands, commit=commit)
|
||||
if diff:
|
||||
result['diff'] = dict(prepared=diff)
|
||||
result['changed'] = True
|
||||
|
||||
module.exit_json(**result)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue