[Openstack] cinder reserve unreserve volume dispose different fot the same situation

Zhangyanzi zhangyanzi at huawei.com
Thu Oct 31 02:19:41 UTC 2013


In reserve volume:

def reserve_volume(self, context, volume):
        ............
        if volume['status'] == 'available':
            self.update(context, volume, {"status": "attaching"})
        else:
            msg = _("Volume status must be available to reserve")
            LOG.error(msg)
            raise exception.InvalidVolume(reason=msg)

In unserve volume:

     def unreserve_volume(self, context, volume):
        if volume['status'] == "attaching":
            self.update(context, volume, {"status": "available"})

Why not raise exception in unreserve_volume, when volume['status']!= "attaching"
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack/attachments/20131031/a6591742/attachment.html>


More information about the Openstack mailing list