diff --git a/karbor/tests/fullstack/karbor_objects.py b/karbor/tests/fullstack/karbor_objects.py index 5073865f..2b2f8f6e 100644 --- a/karbor/tests/fullstack/karbor_objects.py +++ b/karbor/tests/fullstack/karbor_objects.py @@ -273,8 +273,8 @@ class Server(object): def _volume_attached(self, volume_id): volume_item = self.cinder_client.volumes.get(volume_id) - server_attachments = filter(lambda x: x['server_id'] == self.id, - volume_item.attachments) + server_attachments = list(filter(lambda x: x['server_id'] == self.id, + volume_item.attachments)) if len(server_attachments) > 0: return True else: @@ -287,8 +287,8 @@ class Server(object): def _volume_detached(self, volume_id): volume_item = self.cinder_client.volumes.get(volume_id) - server_attachments = filter(lambda x: x['server_id'] == self.id, - volume_item.attachments) + server_attachments = list(filter(lambda x: x['server_id'] == self.id, + volume_item.attachments)) if len(server_attachments) > 0: return False else: diff --git a/karbor/tests/fullstack/test_scheduled_operations.py b/karbor/tests/fullstack/test_scheduled_operations.py index 72a8e286..289cc9e1 100644 --- a/karbor/tests/fullstack/test_scheduled_operations.py +++ b/karbor/tests/fullstack/test_scheduled_operations.py @@ -127,7 +127,7 @@ class ScheduledOperationsTest(karbor_base.KarborBaseTest): operation_item = self.karbor_client.scheduled_operations.get( operation.id) plan_id = operation_item.operation_definition["plan_id"] - cps = filter(lambda x: x.protection_plan["id"] == plan_id, items) + cps = list(filter(lambda x: x.protection_plan["id"] == plan_id, items)) self.assertEqual(freq, len(cps)) for cp in cps: