Skip to content

Commit 795dc01

Browse files
committed
Fix for none type response error handling
1 parent 85f5512 commit 795dc01

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

test/integration/smoke/test_storage_policy.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -161,16 +161,14 @@ def test_01_import_storage_policies(self):
161161
"Check if the number of imported policies is identical to the number of listed policies"
162162
)
163163

164-
are_compatible_pools = False
165164
selected_policy = None
166165
for imported_policy in imported_policies:
167166
compatible_pools = self.list_storage_policy_compatible_pools(self.apiclient, imported_policy.id)
168-
if len(compatible_pools) > 0:
169-
are_compatible_pools = True
167+
if compatible_pools and len(compatible_pools) > 0:
170168
selected_policy = imported_policy
171169
break
172170

173-
if not are_compatible_pools:
171+
if not selected_policy:
174172
self.skipTest("There are no compatible storage pools with the imported policies")
175173

176174
# Create service offering with the first storage policy from the list

0 commit comments

Comments
 (0)