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?

*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.

*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@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev

Reply via email to