<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
</head>
<body bgcolor="#FFFFFF">
<div>I would welcome any patches to true this code up to be more appropriate for our needs. We might as well trim cruft out now if we notice it. Our milestone-2 will add a lot of tests, so it would be great to get a clean start.</div>
<div><br>
</div>
<div>Adrian</div>
<br>
<br>
<div>-------- Original message --------</div>
<div>From: Steven Dake </div>
<div>Date:12/31/2014 11:46 AM (GMT-08:00) </div>
<div>To: "OpenStack Development Mailing List (not for usage questions)" </div>
<div>Subject: Re: [openstack-dev] [Containers][Magnum] Questions on dbapi </div>
<div><br>
</div>
<div>
<div class="moz-cite-prefix">On 12/31/2014 10:54 AM, Hongbin Lu wrote:<br>
</div>
<blockquote type="cite">
<div dir="ltr">Hi all,
<div><br>
</div>
<div>I am writing tests for the Magnum dbapi. I have several questions about its implementation and appreciate if someone could comment on them.</div>
<div><br>
</div>
<div>* 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?</div>
<div><br>
</div>
</div>
</blockquote>
Hongbin,<br>
<br>
Agree we should remove any exceptions that were from Ironic that don't make any sense in Magnum.<br>
<br>
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.<br>
<br>
<blockquote type="cite">
<div dir="ltr">
<div>
<div>
<div><i>class InstanceAssociated(Conflict):</i></div>
<div><i>    message = _("Instance %(instance_uuid)s is already associated with a node,"</i></div>
<div><i>                " it cannot be associated with this other node %(node)s")</i></div>
<div><i><br>
</i></div>
<div><i>class BayAssociated(InvalidState):</i></div>
<div><i>    message = _("Bay %(bay)s is associated with instance %(instance)s.")</i></div>
<div><i><br>
</i></div>
<div><i>class ContainerAssociated(InvalidState):</i></div>
<div><i>    message = _("Container %(container)s is associated with "</i></div>
<div><i>                "instance %(instance)s.")</i></div>
<div><i><br>
</i></div>
<div><i>class PodAssociated(InvalidState):</i></div>
<div><i>    message = _("Pod %(pod)s is associated with instance %(instance)s.")</i></div>
<div><i><br>
</i></div>
<div><i>class ServiceAssociated(InvalidState):</i></div>
<div><i>    message = _("Service %(service)s is associated with "</i></div>
<div><i>                "instance %(instance)s.")</i></div>
</div>
</div>
<div><i><br>
</i></div>
<div><i>NodeAssociated: it is used but definition missing</i></div>
<div><br>
</div>
<div><i>BayModelAssociated: it is used but definition missing</i></div>
<div><br>
</div>
<div>* 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.</div>
<div><br>
</div>
</div>
</blockquote>
Agree they should be removed now and added as needed later.<br>
<br>
<blockquote type="cite">
<div dir="ltr">
<div>
<div><i>def reserve_bay(self, tag, bay_id):</i></div>
<div><i>    """Reserve a bay.</i></div>
<div><i><br>
</i></div>
<div><i>def release_bay(self, tag, bay_id):</i></div>
<div><i>    """Release the reservation on a bay.</i></div>
<div><i><br>
</i></div>
<div><i>def reserve_baymodel(self, tag, baymodel_id):</i></div>
<div><i>    """Reserve a baymodel.</i></div>
<div><i><br>
</i></div>
<div><i>def release_baymodel(self, tag, baymodel_id):</i></div>
<div><i>    """Release the reservation on a baymodel.</i></div>
<div><i><br>
</i></div>
<div><i>def reserve_container(self, tag, container_id):</i></div>
<div><i>    """Reserve a container.</i></div>
<div><i><br>
</i></div>
<div><i>def reserve_node(self, tag, node_id):</i></div>
<div><i>    """Reserve a node.</i></div>
<div><i><br>
</i></div>
<div><i>def release_node(self, tag, node_id):</i></div>
<div><i>    """Release the reservation on a node.</i></div>
<div><i><br>
</i></div>
<div><i>def reserve_pod(self, tag, pod_id):</i></div>
<div><i>    """Reserve a pod.</i></div>
<div><i><br>
</i></div>
<div><i>def release_pod(self, tag, pod_id):</i></div>
<div><i>    """Release the reservation on a pod.</i></div>
<div><i><br>
</i></div>
<div><i>def reserve_service(self, tag, service_id):</i></div>
<div><i>    """Reserve a service.</i></div>
<div><i><br>
</i></div>
<div><i>def release_service(self, tag, service_id):</i></div>
<div><i>    """Release the reservation on a service.</i></div>
</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset> <br>
<pre>_______________________________________________
OpenStack-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:OpenStack-dev@lists.openstack.org">OpenStack-dev@lists.openstack.org</a>
<a class="moz-txt-link-freetext" href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a>
</pre>
</blockquote>
<br>
</div>
</body>
</html>