Skip to content

Commit

Permalink
Change check-detach to reject more states
Browse files Browse the repository at this point in the history
Change check_detach is reject anything other than 'in-use', rather than
just rejecting 'available'.

Fixes bug #1199922

Change-Id: I3180540ca7bb699a3494ca4eea1389ae8a117df0
  • Loading branch information
Duncan Thomas committed Jul 10, 2013
1 parent 2f5e26a commit cfe8dc4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cinder/volume/api.py
Expand Up @@ -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
Expand Down

0 comments on commit cfe8dc4

Please sign in to comment.