mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-25 20:01:25 -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
|
@ -400,8 +400,10 @@ def main():
|
|||
result['warnings'] = warnings
|
||||
|
||||
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
|
||||
|
||||
failed_conditions = check_declarative_intent_params(module, want, result)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue