summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2014-10-15 05:01:25 +0000
committerGerrit Code Review <review@openstack.org>2014-10-15 05:01:25 +0000
commit45e0c7104583e457964922dd236f6456613e304d (patch)
tree8dda85fbe86907b1bf83117a254146e39e4ba025
parente7c5b0abe39724cf8f314a0a45151453e4f7942e (diff)
parent308640c1121f5a4ca33c7723397457e2288c212e (diff)
downloadtempest-45e0c7104583e457964922dd236f6456613e304d.tar.gz
Merge "Fix cleanup for EC2 test_compute_with_volumes"
-rw-r--r--tempest/thirdparty/boto/test.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/tempest/thirdparty/boto/test.py b/tempest/thirdparty/boto/test.py
index 3496dce5d..62073bdc6 100644
--- a/tempest/thirdparty/boto/test.py
+++ b/tempest/thirdparty/boto/test.py
@@ -498,7 +498,10 @@ class BotoTestCase(tempest.test.BaseTestCase):
def _volume_state():
volume.update(validate=True)
try:
- if volume.status != "available":
+ # NOTE(gmann): Make sure volume is attached.
+ # Checking status as 'not "available"' is not enough to make
+ # sure volume is attached as it can be in "error" state
+ if volume.status == "in-use":
volume.detach(force=True)
except BaseException:
LOG.exception("Failed to detach volume %s" % volume)