From cfe8dc42254e6f808bec61f89ea4a43504704000 Mon Sep 17 00:00:00 2001 From: Duncan Thomas Date: Wed, 10 Jul 2013 19:28:39 +0100 Subject: [PATCH] Change check-detach to reject more states Change check_detach is reject anything other than 'in-use', rather than just rejecting 'available'. Fixes bug #1199922 Change-Id: I3180540ca7bb699a3494ca4eea1389ae8a117df0 --- cinder/volume/api.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cinder/volume/api.py b/cinder/volume/api.py index 32f415c3f78..fdb4169f709 100644 --- a/cinder/volume/api.py +++ b/cinder/volume/api.py @@ -501,8 +501,8 @@ def check_attach(self, context, volume): @wrap_check_policy def check_detach(self, context, volume): # TODO(vish): abstract status checking? - if volume['status'] == "available": - msg = _("already detached") + if volume['status'] != "in-use": + msg = _("status must be in-use to detach") raise exception.InvalidVolume(reason=msg) @wrap_check_policy