Fix junos_netconf integration test failure (#27528)

pull/26805/head
Ganesh Nalawade 7 years ago committed by GitHub
parent 0b9a78f0b3
commit 7cf4416c9c

@ -161,6 +161,7 @@ def load_config(module, config, commit=False):
exec_command(module, 'top')
rc, diff, err = exec_command(module, 'show | compare')
if diff:
if commit:
exec_command(module, 'commit and-quit')
else:
@ -196,16 +197,11 @@ def main():
if commands:
commit = not module.check_mode
diff = load_config(module, commands)
diff = load_config(module, commands, commit=commit)
if diff:
if commit:
commit_configuration(module)
else:
discard_changes(module)
result['changed'] = True
if module._diff:
result['diff'] = {'prepared': diff}
result['changed'] = True
module.exit_json(**result)

Loading…
Cancel
Save