Remove check_{attach,detach} from volumes API
These methods are not called from anywhere and are likely just a relic from splitting Cinder out from Nova. Moreover their usage from the API should really be discouraged as they are inherently racy (the result is immediately outdated since it is not atomic with anything that might follow). Partial-bug: #1302774 Change-Id: I5d79b22b2a1d3c9be429a13d094328fc2075fcd2
This commit is contained in:
parent
d955c1da44
commit
27fe5638ca
@ -20,8 +20,6 @@
|
||||
"volume:unreserve_volume": [],
|
||||
"volume:begin_detaching": [],
|
||||
"volume:roll_detaching": [],
|
||||
"volume:check_attach": [],
|
||||
"volume:check_detach": [],
|
||||
"volume:initialize_connection": [],
|
||||
"volume:terminate_connection": [],
|
||||
"volume:create_snapshot": [],
|
||||
|
@ -343,23 +343,6 @@ class API(base.Base):
|
||||
snapshots = results
|
||||
return snapshots
|
||||
|
||||
@wrap_check_policy
|
||||
def check_attach(self, volume):
|
||||
# TODO(vish): abstract status checking?
|
||||
if volume['status'] != "available":
|
||||
msg = _("status must be available")
|
||||
raise exception.InvalidVolume(reason=msg)
|
||||
if volume['attach_status'] == "attached":
|
||||
msg = _("already attached")
|
||||
raise exception.InvalidVolume(reason=msg)
|
||||
|
||||
@wrap_check_policy
|
||||
def check_detach(self, volume):
|
||||
# TODO(vish): abstract status checking?
|
||||
if volume['status'] != "in-use":
|
||||
msg = _("status must be in-use to detach")
|
||||
raise exception.InvalidVolume(reason=msg)
|
||||
|
||||
@wrap_check_policy
|
||||
def reserve_volume(self, context, volume):
|
||||
#NOTE(jdg): check for Race condition bug 1096983
|
||||
|
Loading…
Reference in New Issue
Block a user