1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

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

This commit is contained in:
Suan Kan 2017-11-02 17:25:37 +11:00 committed by Ganesh Nalawade
parent 6a0e8cae10
commit 690a626d0d

View file

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