[openstack-dev] [Containers][Magnum] Questions on dbapi

Steven Dake sdake at redhat.com
Wed Dec 31 19:43:33 UTC 2014


On 12/31/2014 10:54 AM, Hongbin Lu wrote:
> Hi all,
>
> I am writing tests for the Magnum dbapi. I have several questions 
> about its implementation and appreciate if someone could comment on them.
>
> * Exceptions: The exceptions below were ported from Ironic but don't 
> seem to make sense in Magnum. I think we should purge them from the 
> code except InstanceAssociated and NodeAssociated. Do everyone agree?
>
Hongbin,

Agree we should remove any exceptions that were from Ironic that don't 
make any sense in Magnum.

The only reason I copied alot of Ironic code base was to pull in the 
versioned objects support which should be heading to oslo at some point.

> /class InstanceAssociated(Conflict):/
> /    message = _("Instance %(instance_uuid)s is already associated 
> with a node,"/
> /                " it cannot be associated with this other node 
> %(node)s")/
> /
> /
> /class BayAssociated(InvalidState):/
> /    message = _("Bay %(bay)s is associated with instance %(instance)s.")/
> /
> /
> /class ContainerAssociated(InvalidState):/
> /    message = _("Container %(container)s is associated with "/
> /                "instance %(instance)s.")/
> /
> /
> /class PodAssociated(InvalidState):/
> /    message = _("Pod %(pod)s is associated with instance %(instance)s.")/
> /
> /
> /class ServiceAssociated(InvalidState):/
> /    message = _("Service %(service)s is associated with "/
> /                "instance %(instance)s.")/
> /
> /
> /NodeAssociated: it is used but definition missing/
>
> /BayModelAssociated: it is used but definition missing/
>
> * APIs: the APIs below seem to be ported from Ironic Node, but it 
> seems we won't need them all. Again, I think we should purge some of 
> them that does not make sense. In addition, these APIs are defined 
> without being call. Does it make sense remove them for now, and add 
> them one by one later when they are actually needed.
>
Agree they should be removed now and added as needed later.

> /def reserve_bay(self, tag, bay_id):/
> /    """Reserve a bay./
> /
> /
> /def release_bay(self, tag, bay_id):/
> /    """Release the reservation on a bay./
> /
> /
> /def reserve_baymodel(self, tag, baymodel_id):/
> /    """Reserve a baymodel./
> /
> /
> /def release_baymodel(self, tag, baymodel_id):/
> /    """Release the reservation on a baymodel./
> /
> /
> /def reserve_container(self, tag, container_id):/
> /    """Reserve a container./
> /
> /
> /def reserve_node(self, tag, node_id):/
> /    """Reserve a node./
> /
> /
> /def release_node(self, tag, node_id):/
> /    """Release the reservation on a node./
> /
> /
> /def reserve_pod(self, tag, pod_id):/
> /    """Reserve a pod./
> /
> /
> /def release_pod(self, tag, pod_id):/
> /    """Release the reservation on a pod./
> /
> /
> /def reserve_service(self, tag, service_id):/
> /    """Reserve a service./
> /
> /
> /def release_service(self, tag, service_id):/
> /    """Release the reservation on a service./
>
>
> _______________________________________________
> OpenStack-dev mailing list
> OpenStack-dev at lists.openstack.org
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20141231/24c400f7/attachment.html>


More information about the OpenStack-dev mailing list