[openstack-dev] [keystone]Why not common definition about normal HTTP status code like 2xx and 3xx?

Neo Liu diabloneo at gmail.com
Thu Jun 4 03:04:52 UTC 2015


On Thu, Jun 4, 2015 at 4:43 AM Brant Knudson <blk at acm.org> wrote:

>
>
> On Tue, Jun 2, 2015 at 4:32 AM, Chenhong Liu <liuchenhong at unitedstack.com>
> wrote:
>
>> 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:
>>     exception.Forbidden.code, exception.forbiddent.title
>>     exception.NotFound.code, exception.NotFound.title
>>
>> 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.
>>
>> How about add those definitions?
>>
>>
> Looks like Python 3.5 added constants in http.HTTPStatus[1]. So someday
> we'll be able to use those instead.
>
> [1] https://docs.python.org/3.5/library/http.html#http.HTTPStatus
>
> Sincerely, Brant
>
>
This will be a good choice.


>
> __________________________________________________________________________
> OpenStack Development Mailing List (not for usage questions)
> Unsubscribe: OpenStack-dev-request at lists.openstack.org?subject:unsubscribe
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20150604/326669d7/attachment.html>


More information about the OpenStack-dev mailing list