From 0cd073fdd42ed19186719862ed78006738d89f3e Mon Sep 17 00:00:00 2001 From: Valerii Ponomarov Date: Thu, 5 Dec 2019 23:50:48 +0530 Subject: [py2to3] Fix various py3 incompatibilities Change-Id: I6c517278c3f8bf6f374ab60bc27768e503161278 --- tests/functional/arbiter/test_arbiter.py | 4 ++-- .../functional/gluster_stability/test_gluster_block_stability.py | 8 ++++---- tests/functional/test_node_restart.py | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) (limited to 'tests/functional') diff --git a/tests/functional/arbiter/test_arbiter.py b/tests/functional/arbiter/test_arbiter.py index ea61c1f0..fb284e0c 100644 --- a/tests/functional/arbiter/test_arbiter.py +++ b/tests/functional/arbiter/test_arbiter.py @@ -351,9 +351,9 @@ class TestArbiterVolumeCreateExpandDelete(baseclass.BaseClass): self.verify_amount_and_proportion_of_arbiter_and_data_bricks( vol_info)) - expected_file_amount = pvc_size_gb * 1024**2 / (avg_file_size or 64) + expected_file_amount = pvc_size_gb * 1024**2 // (avg_file_size or 64) expected_file_amount = ( - expected_file_amount / bricks_info['arbiter_amount']) + expected_file_amount // bricks_info['arbiter_amount']) # Try to create expected amount of files on arbiter brick mount passed_arbiter_bricks = [] diff --git a/tests/functional/gluster_stability/test_gluster_block_stability.py b/tests/functional/gluster_stability/test_gluster_block_stability.py index 8f31fd24..15393bf4 100644 --- a/tests/functional/gluster_stability/test_gluster_block_stability.py +++ b/tests/functional/gluster_stability/test_gluster_block_stability.py @@ -672,12 +672,12 @@ class TestGlusterBlockStability(GlusterBlockBaseClass): target_portal_list = sorted(set(target_portal_list)) unmatched_gips = (set(host_ips) ^ set(gluster_ips_bv_flattend)) unmatched_tpips = (set(host_ips) ^ set(target_portal_list)) - self.assertEqual( - cmp(host_ips, gluster_ips_bv_flattend), 0, + self.assertFalse( + unmatched_gips, "Could not match glusterips in blockvolumes, difference is %s " % unmatched_gips) - self.assertEqual( - cmp(host_ips, target_portal_list), 0, + self.assertFalse( + unmatched_tpips, "Could not match glusterips in pv describe, difference is %s " % unmatched_tpips) diff --git a/tests/functional/test_node_restart.py b/tests/functional/test_node_restart.py index 8bf70f7c..6a718cbe 100644 --- a/tests/functional/test_node_restart.py +++ b/tests/functional/test_node_restart.py @@ -76,9 +76,9 @@ class TestNodeRestart(BaseClass): def reboot_gluster_node_and_wait_for_services(self): gluster_node_ip = ( g.config["gluster_servers"][self.gluster_servers[0]]["storage"]) - gluster_pod = filter( + gluster_pod = list(filter( lambda pod: (pod["pod_host_ip"] == gluster_node_ip), - get_ocp_gluster_pod_details(self.oc_node)) + get_ocp_gluster_pod_details(self.oc_node))) if not gluster_pod: raise ExecutionError( "Gluster pod Host IP '%s' not matched." % gluster_node_ip) -- cgit