[openstack-dev] Is WSME really suitable? (Was: [nova] Autogenerating the Nova v3 API specification)

Mac Innes, Kiall kiall at hp.com
Tue Aug 6 21:17:06 UTC 2013


On 06/08/13 21:56, Jonathan LaCour wrote:
> James Slagle <james.slagle at gmail.com> wrote:
>
>> WSME + pecan is being used in Tuskar:
>> https://github.com/tuskar/tuskar (OpenStack management API)
>>
>> We encountered the same issue discussed here.  A solution we settled
>> on for now was to use a custom Renderer class that could handle
>> different response codes.  You set the renderer in the call to
>> pecan.make_app.  This was meant to be a temporary solution until
>> there's better support in WSME.
>
> If there is anything I can do on the Pecan side, let me know! Happy to build in new functionality to make this easier, in general. It does seem to make sense to be fixed on the WSME side, though.
>
> Best --
>
> - Jonathan

Nah - this is entirely on the WSME side :)

WSME translate all exceptions that don't extend their ClientExcption to 
HTTP 500, and anything that does to HTTP 400.

Beyond that, you only have the "default status code" to work with - 401, 
404, 503 etc are all off limits with stock WSME. Literally you have a 
default code for successful requests, and 400 or 500. Nothing else.

It seems like Ceilometer has worked there way around it using the 
"_lookup" method for 404's (but I can't find how they return any other 
status codes..), and libra + tuskar have replaced the WSME error 
handling for something entirely custom.

We're not massively interested in replacing WSME's error handling with 
something custom, so our plan is to just use Pecan and ignore WSME for 
the Designate v2 API. When it's ready, hopefully the switch won't be too 
painful!

Thanks,
Kiall




More information about the OpenStack-dev mailing list