Skip to content

Commit 8a68539

Browse files
Execute cleanup even after exceptions during tests
Signed-off-by: Markus Hentsch <[email protected]>
1 parent 09b66c2 commit 8a68539

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -301,8 +301,10 @@ def main():
301301
cleanup(conn, prefix=args.prefix, timeout=args.timeout)
302302
else:
303303
cleanup(conn, prefix=args.prefix, timeout=args.timeout)
304-
test_backup(conn, prefix=args.prefix, timeout=args.timeout)
305-
cleanup(conn, prefix=args.prefix, timeout=args.timeout)
304+
try:
305+
test_backup(conn, prefix=args.prefix, timeout=args.timeout)
306+
finally:
307+
cleanup(conn, prefix=args.prefix, timeout=args.timeout)
306308

307309

308310
if __name__ == "__main__":

0 commit comments

Comments
 (0)