<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Thu, Jun 4, 2015 at 4:43 AM Brant Knudson <<a href="mailto:blk@acm.org">blk@acm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jun 2, 2015 at 4:32 AM, Chenhong Liu <span dir="ltr"><<a href="mailto:liuchenhong@unitedstack.com" target="_blank">liuchenhong@unitedstack.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">There is keystone/exception.py which contains Exceptions defined and used inside keystone provide 4xx and 5xx status code. And we can use it like:<div> exception.Forbidden.code, exception.forbiddent.title</div><div> exception.NotFound.code, exception.NotFound.title</div><div><br></div><div>This makes the code looks pretty and avoid error prone. But I can't find definition for other status code, like 200, 201, 204, 302, and so on. The code in keystone, especially the unit test cases, just write these status code and title explicitly.</div><div><br></div><div>How about add those definitions?</div></div><br></blockquote></div></div></div><div dir="ltr"><div class="gmail_extra"><br>Looks like Python 3.5 added constants in http.HTTPStatus[1]. So someday we'll be able to use those instead.<br><br>[1] <a href="https://docs.python.org/3.5/library/http.html#http.HTTPStatus" target="_blank">https://docs.python.org/3.5/library/http.html#http.HTTPStatus</a><br><br></div><div class="gmail_extra">Sincerely, Brant<br><br></div></div></blockquote><div><br></div><div>This will be a good choice.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"></div><div class="gmail_extra"><br></div></div>
__________________________________________________________________________<br>
OpenStack Development Mailing List (not for usage questions)<br>
Unsubscribe: <a href="http://OpenStack-dev-request@lists.openstack.org?subject:unsubscribe" target="_blank">OpenStack-dev-request@lists.openstack.org?subject:unsubscribe</a><br>
<a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a><br>
</blockquote></div></div>