From 2f47edef2d3cb56137000baca6640aec6696c00e Mon Sep 17 00:00:00 2001 From: vamahaja Date: Thu, 12 Dec 2019 15:52:24 +0530 Subject: Handle empty list of 'additional_gluster_servers' correctly In the 'test_heketi_node_operations::TestHeketiNodeOperations' class, if we define 'additional_gluster_servers' option, but do not provide there any value, then we fail. But, "skip" is expected in such situation. So, catch "IndexError" exception and make tests be skipped after it. Change-Id: Idfb1cdfc6941d284a4dc8e670c2eb5510eafe744 Signed-off-by: vamahaja --- tests/functional/heketi/test_heketi_node_operations.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests/functional') diff --git a/tests/functional/heketi/test_heketi_node_operations.py b/tests/functional/heketi/test_heketi_node_operations.py index ec53afc0..c4908b3c 100644 --- a/tests/functional/heketi/test_heketi_node_operations.py +++ b/tests/functional/heketi/test_heketi_node_operations.py @@ -263,7 +263,7 @@ class TestHeketiNodeOperations(baseclass.BaseClass): self.additional_gluster_servers_info = ( g.config['additional_gluster_servers']) return list(self.additional_gluster_servers_info.values())[0] - except (KeyError, AttributeError): + except (KeyError, AttributeError, IndexError): self.skipTest("Required 'additional_gluster_servers' option is " "not set in the config file.") -- cgit