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

Zhangyanzi zhangyanzi at huawei.com
Thu Oct 31 03:11:40 UTC 2013


This situation also appears in other methods of cinder.
Is it right?

发件人: Zhangyanzi [mailto:zhangyanzi at huawei.com]
发送时间: 2013年10月31日 10:20
收件人: openstack at lists.openstack.org
抄送: gfidente at redhat.com
主题: [Openstack] cinder reserve unreserve volume dispose different fot the same situation

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/f09c67a8/attachment.html>


More information about the Openstack mailing list