diff --git a/network/nxos/nxos_smu.py b/network/nxos/nxos_smu.py index e7584de313f..ddab9f0d2b0 100644 --- a/network/nxos/nxos_smu.py +++ b/network/nxos/nxos_smu.py @@ -853,7 +853,8 @@ def main(): try: apply_patch(module, commands) changed=True - except Exception as e: + except ShellError: + e = get_exception() module.fail_json(msg=str(e)) module.exit_json(changed=changed,