From cb9f28c0d648496a01fb7dc1afc8a6cfb6d81e10 Mon Sep 17 00:00:00 2001 From: GGabriele Date: Fri, 2 Sep 2016 19:07:38 +0200 Subject: [PATCH] Fix error handling --- network/nxos/nxos_hsrp.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/network/nxos/nxos_hsrp.py b/network/nxos/nxos_hsrp.py index 7967aac7b2c..174915cb515 100644 --- a/network/nxos/nxos_hsrp.py +++ b/network/nxos/nxos_hsrp.py @@ -799,7 +799,8 @@ def load_config(module, candidate): def execute_config_command(commands, module): try: body = module.configure(commands) - except ShellError, clie: + except ShellError: + clie = get_exception() module.fail_json(msg='Error sending CLI commands', error=str(clie), commands=commands) return body