Fix AttributeError on BadRequest in scenario tests
Fixing the following incorrectly raised exception:
_StringException: Traceback (most recent call last):
File "tempest/scenario/manager.py", line 251, in tearDownClass
if e.__class__.__name__ == 'NotFound' or e.status_code == 404:
AttributeError: 'BadRequest' object has no attribute 'status_code'
Change-Id: I3ee006720328c0a5aabbc7766f997a032dfa8230
diff --git a/tempest/scenario/manager.py b/tempest/scenario/manager.py
index 9f97964..d2b30ff 100644
--- a/tempest/scenario/manager.py
+++ b/tempest/scenario/manager.py
@@ -248,7 +248,8 @@
except Exception as e:
# If the resource is already missing, mission accomplished.
# add status code as workaround for bug 1247568
- if e.__class__.__name__ == 'NotFound' or e.status_code == 404:
+ if (e.__class__.__name__ == 'NotFound' or
+ hasattr(e, 'status_code') and e.status_code == 404):
continue
raise