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:
Kedar Kekan 2017-12-07 20:14:57 +05:30 committed by GitHub
commit 012a96dabd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 68 additions and 55 deletions

View file

@ -246,11 +246,12 @@ def run(module, result):
result['commands'] = commands
diff = load_config(module, commands, result['warnings'],
not check_mode, replace_config, comment, admin)
commit = not check_mode
diff = load_config(module, commands, commit=commit, replace=replace_config,
comment=comment, admin=admin)
if diff:
result['diff'] = dict(prepared=diff)
result['changed'] = True
result['changed'] = True
def main():