From f8508c0cd42d8e1ba18e06d79f9ef515faa36fe2 Mon Sep 17 00:00:00 2001 From: Valerii Ponomarov Date: Thu, 19 Jul 2018 17:27:42 +0530 Subject: Refactor 'heketi_node_list' function Do following improvements to this function: - Remove support of python Heketi client, because it is dead code. It is dead code, because all of the tests which use this function, explicitly depend on the CLI output, not being compatible with it. - Remove useless 'json' arg, as CLI client does not support it for 'node list' command. - Parse list of node IDs in it, not delegating this to the consumer. - Raise exception in case we failed to get list of nodes And, of course, update all the places where this function is used. Making those places use less code compared to previous variant. Change-Id: I3f1ffe6082541e63dc3d638c19c54086aa12580f --- .../common/heketi/heketi_tests/test_create_heketi_volume_size_60.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'tests/functional/common/heketi/heketi_tests/test_create_heketi_volume_size_60.py') diff --git a/tests/functional/common/heketi/heketi_tests/test_create_heketi_volume_size_60.py b/tests/functional/common/heketi/heketi_tests/test_create_heketi_volume_size_60.py index 62448b92..d871be30 100644 --- a/tests/functional/common/heketi/heketi_tests/test_create_heketi_volume_size_60.py +++ b/tests/functional/common/heketi/heketi_tests/test_create_heketi_volume_size_60.py @@ -25,13 +25,9 @@ class TestHeketiVolume(HeketiClientSetupBaseClass): Get free space in each devices """ free_spaces = [] - heketi_node_id_list = [] device_list = [] - heketi_node_list_string = heketi_node_list( + heketi_node_id_list = heketi_node_list( self.heketi_client_node, self.heketi_server_url) - for line in heketi_node_list_string.strip().split("\n"): - heketi_node_id_list.append(line.strip().split( - "Cluster")[0].strip().split(":")[1]) for node_id in heketi_node_id_list: node_info_dict = heketi_node_info(self.heketi_client_node, self.heketi_server_url, -- cgit