Fix containers with expired objects deletion problem
This fix adds a try/except statement around delete object function,
in order to be sure that even if one of the objects that is listed
in container is expired/is not found the containers will still
be deleted.
Change-Id: Ie49ce66304aefcb8264001b811859c8768e61fc7
Closes-Bug: #1281599
diff --git a/tempest/api/object_storage/base.py b/tempest/api/object_storage/base.py
index ef36c3d..c44e60a 100644
--- a/tempest/api/object_storage/base.py
+++ b/tempest/api/object_storage/base.py
@@ -130,7 +130,10 @@
objlist = container_client.list_all_container_objects(cont)
# delete every object in the container
for obj in objlist:
- object_client.delete_object(cont, obj['name'])
+ try:
+ object_client.delete_object(cont, obj['name'])
+ except exceptions.NotFound:
+ pass
container_client.delete_container(cont)
except exceptions.NotFound:
pass