diff options
author | vamahaja <vamahaja@redhat.com> | 2019-12-12 15:52:24 +0530 |
---|---|---|
committer | vponomar <vponomar@redhat.com> | 2019-12-12 12:56:03 +0000 |
commit | 2f47edef2d3cb56137000baca6640aec6696c00e (patch) | |
tree | cf38decb651020d128996c05a32915094f2f9db1 /tests | |
parent | 512da588160e667b7028115acb4a35c2c5663dce (diff) |
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 <vamahaja@redhat.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/functional/heketi/test_heketi_node_operations.py | 2 |
1 files changed, 1 insertions, 1 deletions
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.") |