diff options
author | Valerii Ponomarov <vponomar@redhat.com> | 2018-07-19 17:27:42 +0530 |
---|---|---|
committer | Valerii Ponomarov <vponomar@redhat.com> | 2018-07-19 17:36:34 +0530 |
commit | f8508c0cd42d8e1ba18e06d79f9ef515faa36fe2 (patch) | |
tree | 07af46d8cbb5e13ca0c55aa356f81311640cb245 /tests/functional/common/heketi/heketi_tests/test_create_heketi_volume_size_60.py | |
parent | b7f6a80ceb1af26dec130facb64485ded0db18b2 (diff) |
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
Diffstat (limited to 'tests/functional/common/heketi/heketi_tests/test_create_heketi_volume_size_60.py')
-rw-r--r-- | tests/functional/common/heketi/heketi_tests/test_create_heketi_volume_size_60.py | 6 |
1 files changed, 1 insertions, 5 deletions
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, |