Skip to content

Commit 51d839b

Browse files
Apply review suggestion to simplify code
Co-authored-by: Matthias Büchse <[email protected]> Signed-off-by: Markus Hentsch <[email protected]>
1 parent 9f84957 commit 51d839b

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

Tests/iaas/volume-backup/volume-backup-tester.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -231,16 +231,14 @@ def wait_for_resource(resource_type: str, resource_id: str,
231231
) > 0:
232232
time.sleep(1.0)
233233
seconds_waited += 1
234-
try:
235-
ensure(
236-
seconds_waited < timeout,
237-
f"Timeout reached while waiting for all backups with prefix "
234+
if seconds_waited >= timeout:
235+
cleanup_was_successful = False
236+
print(
237+
"WARNING:"
238+
"Timeout reached while waiting for all backups with prefix "
238239
f"'{prefix}' to finish deletion during cleanup after "
239240
f"{seconds_waited} seconds"
240241
)
241-
except ConformanceTestException as e:
242-
print("WARNING:", str(e))
243-
cleanup_was_successful = False
244242
break
245243

246244
volumes = conn.block_storage.volumes()

0 commit comments

Comments
 (0)