<div dir="ltr">Hi, Thanks for your reply, after check again and I agree with you. I think we should come up with a conclusion about how we should treat this limit=0 across nova. And that's also why I sent out this mail. I will register this topic in the API meeting open discussion section, my be a BP in M to fix this.<div><br></div><div>BR,</div><div><br></div><div>Zheng</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Sep 12, 2015 at 12:07 AM, Kevin L. Mitchell <span dir="ltr"><<a href="mailto:kevin.mitchell@rackspace.com" target="_blank">kevin.mitchell@rackspace.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Fri, 2015-09-11 at 15:41 +0800, Zhenyu Zheng wrote:<br>
> Hi, I found out that nova currently handles list with limit=0 quite<br>
> different for different objects.<br>
><br>
> Especially when list servers:<br>
><br>
> According to the code:<br>
> <a href="http://git.openstack.org/cgit/openstack/nova/tree/nova/api/openstack/common.py#n206" rel="noreferrer" target="_blank">http://git.openstack.org/cgit/openstack/nova/tree/nova/api/openstack/common.py#n206</a><br>
><br>
> when limit = 0, it should apply as max_limit, but currently, in:<br>
> <a href="http://git.openstack.org/cgit/openstack/nova/tree/nova/db/sqlalchemy/api.py#n1930" rel="noreferrer" target="_blank">http://git.openstack.org/cgit/openstack/nova/tree/nova/db/sqlalchemy/api.py#n1930</a><br>
><br>
> we directly return [], this is quite different with comment in the api<br>
> code.<br>
><br>
><br>
> I checked other objects:<br>
><br>
> when list security groups and server groups, it will return as no<br>
> limit has been set. And for flavors it returns []. I will continue to<br>
> try out other APIs if needed.<br>
><br>
> I think maybe we should make a rule for all objects, at least fix the<br>
> servers to make it same in api and db code.<br>
><br>
> I have reported a bug in launchpad:<br>
><br>
> <a href="https://bugs.launchpad.net/nova/+bug/1494617" rel="noreferrer" target="_blank">https://bugs.launchpad.net/nova/+bug/1494617</a><br>
><br>
><br>
> Any suggestions?<br>
<br>
</span>After seeing the test failures that showed up on your proposed fix, I'm<br>
thinking that the proposed change reads like an API change, requiring a<br>
microversion bump. That said, I approve of increased consistency across<br>
the API, and perhaps the behavior on limit=0 is something the API group<br>
needs to discuss a guideline for?<br>
<span class="HOEnZb"><font color="#888888">--<br>
Kevin L. Mitchell <<a href="mailto:kevin.mitchell@rackspace.com">kevin.mitchell@rackspace.com</a>><br>
Rackspace<br>
<br>
<br>
__________________________________________________________________________<br>
OpenStack Development Mailing List (not for usage questions)<br>
Unsubscribe: <a href="http://OpenStack-dev-request@lists.openstack.org?subject:unsubscribe" rel="noreferrer" target="_blank">OpenStack-dev-request@lists.openstack.org?subject:unsubscribe</a><br>
<a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" rel="noreferrer" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a><br>
</font></span></blockquote></div><br></div>