Catching Exception doesn't catch KeyboardInterrupt that should be handled
and fill cmd_res which is being used in the finally block.
Signed-off-by: Roi Dayan <roid(a)mellanox.com>
---
lnst/Controller/NetTestController.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lnst/Controller/NetTestController.py b/lnst/Controller/NetTestController.py
index c8a58b3..a040933 100644
--- a/lnst/Controller/NetTestController.py
+++ b/lnst/Controller/NetTestController.py
@@ -760,7 +760,7 @@ class NetTestController:
try:
cmd_res = machine.run_command(command)
- except Exception as exc:
+ except (KeyboardInterrupt, Exception) as exc:
cmd_res = {"passed": False,
"res_data": {"Exception": str(exc)},
"msg": "Exception raised.",
--
1.8.4.3