Use call_and_ignore_notfound_exc method
Updating 'clear_snapshots' method for using call_and_ignore_notfound_exc
method, in order to prevent a duplicated code.
Change-Id: Ice75db8634115b5a0bd7a262a3d6e11a626ea939
diff --git a/tempest/api/volume/base.py b/tempest/api/volume/base.py
index 178b0b1..aca2049 100644
--- a/tempest/api/volume/base.py
+++ b/tempest/api/volume/base.py
@@ -188,16 +188,13 @@
@classmethod
def clear_snapshots(cls):
for snapshot in cls.snapshots:
- try:
- cls.snapshots_client.delete_snapshot(snapshot['id'])
- except Exception:
- pass
+ test_utils.call_and_ignore_notfound_exc(
+ cls.snapshots_client.delete_snapshot, snapshot['id'])
for snapshot in cls.snapshots:
- try:
- cls.snapshots_client.wait_for_resource_deletion(snapshot['id'])
- except Exception:
- pass
+ test_utils.call_and_ignore_notfound_exc(
+ cls.snapshots_client.wait_for_resource_deletion,
+ snapshot['id'])
def create_server(self, **kwargs):
name = kwargs.pop(