From f4bfc0818699ce42d55425e2135a020ad7f81ab3 Mon Sep 17 00:00:00 2001 From: STARTX Date: Wed, 15 Jun 2022 00:33:59 +0200 Subject: [PATCH] debug error message when network interface not found (#268) Debug error occured when giving a bad network interface list Traceback (most recent call last): File "/root/kraken/run_kraken.py", line 318, in main(options.cfg) File "/root/kraken/run_kraken.py", line 239, in main network_chaos.run(scenarios_list, config, wait_duration) File "/root/kraken/kraken/network_chaos/actions.py", line 39, in run test_interface = verify_interface(test_interface, nodelst, pod_template) File "/root/kraken/kraken/network_chaos/actions.py", line 111, in verify_interface "Interface %s not found in node %s interface list %s" % (interface, nodelst[pod_index]), TypeError: not enough arguments for format string Signed-off-by: STARTX --- kraken/network_chaos/actions.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/kraken/network_chaos/actions.py b/kraken/network_chaos/actions.py index 8f92ffdf..9100d27d 100644 --- a/kraken/network_chaos/actions.py +++ b/kraken/network_chaos/actions.py @@ -107,10 +107,7 @@ def verify_interface(test_interface, nodelst, template): interface_lst = output[:-1].split(",") for interface in test_interface: if interface not in interface_lst: - logging.error( - "Interface %s not found in node %s interface list %s" % (interface, nodelst[pod_index]), - interface_lst, - ) + logging.error("Interface %s not found in node %s interface list %s" % (interface, nodelst[pod_index], interface_lst)) sys.exit(1) return test_interface finally: