Merge "Fix cleanup for EC2 test_compute_with_volumes"
diff --git a/tempest/thirdparty/boto/test.py b/tempest/thirdparty/boto/test.py
index 3496dce..62073bd 100644
--- a/tempest/thirdparty/boto/test.py
+++ b/tempest/thirdparty/boto/test.py
@@ -498,7 +498,10 @@
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)