<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Mar 17, 2014 at 2:16 PM, Chris Friesen <span dir="ltr"><<a href="mailto:chris.friesen@windriver.com" target="_blank">chris.friesen@windriver.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><br>
I've submitted code for review at "<a href="https://review.openstack.org/80808" target="_blank">https://review.openstack.org/<u></u>80808</a>" but it seems to break the unit tests.<br>
<br>
Where do the "deleted" and "deleted_at" fields for the instance get created for unit tests?  Where is the database stored for unit tests, and is there a way to look at it directly?<br>
<br>
Here is what's confusing me.  I added a breakpoint in the testcase at the point where it's trying to retrieve the instances.<br>
<br>
<br>
The original code looks like this:<br>
<br>
filters = {'uuid': filter_uuids, 'deleted_at': None}<br>
instances = instance_obj.InstanceList.get_<u></u>by_filters(context, filters=filters)<br>
<br>
If I run that code, I get three instances, as expected.<br>
<br>
<br>
If I change it to "filters = {'uuid': filter_uuids, 'deleted': 0}" and rerun get_by_filters() then I get no instances in the result.<br>
<br>
<br>
However, if I run "db.instance_get_all()" and look at the result, there are three instances and the "deleted" field is zero in each case:<br>
<br>
(Pdb) db.instance_get_all(context)[<u></u>0]['deleted']<br>
0<br>
(Pdb) db.instance_get_all(context)[<u></u>1]['deleted']<br>
0<br>
(Pdb) db.instance_get_all(context)[<u></u>2]['deleted']<br>
0<br>
<br>
<br>
So why does it fail if I try and filter by the "deleted" field?</blockquote><div><br></div><div><br></div><div>See <a href="http://git.openstack.org/cgit/openstack/nova/tree/nova/db/sqlalchemy/api.py#n1848">http://git.openstack.org/cgit/openstack/nova/tree/nova/db/sqlalchemy/api.py#n1848</a></div>

<div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<br>
<br>
Thanks,<br>
Chris<br>
<br>
______________________________<u></u>_________________<br>
OpenStack-dev mailing list<br>
<a href="mailto:OpenStack-dev@lists.openstack.org" target="_blank">OpenStack-dev@lists.openstack.<u></u>org</a><br>
<a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" target="_blank">http://lists.openstack.org/<u></u>cgi-bin/mailman/listinfo/<u></u>openstack-dev</a><br>
</blockquote></div><br></div></div>