Issue #32416. Fix exit from configuration mode in case of command failure (#32417)

pull/29160/merge
Suan Kan 7 years ago committed by Ganesh Nalawade
parent 6a0e8cae10
commit 690a626d0d

@ -133,6 +133,7 @@ def load_config(module, commands):
continue continue
rc, out, err = exec_command(module, command) rc, out, err = exec_command(module, command)
if rc != 0: if rc != 0:
exec_command(module, 'end')
module.fail_json(msg=to_text(err, errors='surrogate_then_replace'), command=command, rc=rc) module.fail_json(msg=to_text(err, errors='surrogate_then_replace'), command=command, rc=rc)
exec_command(module, 'end') exec_command(module, 'end')

Loading…
Cancel
Save