From 795dc01212afb8b3f3334f54af91883f40edaab7 Mon Sep 17 00:00:00 2001 From: nvazquez Date: Sun, 25 Oct 2020 15:14:04 -0300 Subject: [PATCH] Fix for none type response error handling --- test/integration/smoke/test_storage_policy.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/test/integration/smoke/test_storage_policy.py b/test/integration/smoke/test_storage_policy.py index 14f607ac862..c995b9e3fa1 100644 --- a/test/integration/smoke/test_storage_policy.py +++ b/test/integration/smoke/test_storage_policy.py @@ -161,16 +161,14 @@ class TestVMWareStoragePolicies(cloudstackTestCase): "Check if the number of imported policies is identical to the number of listed policies" ) - are_compatible_pools = False selected_policy = None for imported_policy in imported_policies: compatible_pools = self.list_storage_policy_compatible_pools(self.apiclient, imported_policy.id) - if len(compatible_pools) > 0: - are_compatible_pools = True + if compatible_pools and len(compatible_pools) > 0: selected_policy = imported_policy break - if not are_compatible_pools: + if not selected_policy: self.skipTest("There are no compatible storage pools with the imported policies") # Create service offering with the first storage policy from the list