diff --git a/cinder/tests/policy.json b/cinder/tests/policy.json index 4347c2c8f5b..608755f1626 100644 --- a/cinder/tests/policy.json +++ b/cinder/tests/policy.json @@ -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": [], diff --git a/cinder/volume/api.py b/cinder/volume/api.py index 33e5dc8a4bd..a44513d076b 100644 --- a/cinder/volume/api.py +++ b/cinder/volume/api.py @@ -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