[openstack-dev] [Fuel] Pecan migration status
pkaminski at mirantis.com
Tue Mar 24 08:09:17 UTC 2015
BTW, old urls do not match as yet exactly the new ones. There is a need
to write a test that will check all urls.py list and compare with new
handlers' urls to make sure nothing was missed.
On 03/24/2015 08:46 AM, Przemyslaw Kaminski wrote:
> I want to summarize work I've done in spare time on migrating our API to
> Pecan . This is partially based on previous Nicolay's work . One
> test is still failing there but it's some DB lock and I'm not 100% sure
> that this is caused because something is yet not done on Pecan side or
> just some bug popped out (I was getting a different DB lock before but
> it disappeared after rebasing a fix for ).
> My main commitment here is the 'reverse' method  which is not
> provided by default in Pecan. I have kept compatibility with original
> reverse method in our code. I have additionally added a 'qs' keyword
> argument that is used for adding a query string to the URL (see
> I decided to keep original Nicolay's idea of copying all handlers to v2
> directory and not just modify original v1 handlers and concentrated
> instead of removing hacks around Pecan as in  (with post_all,
> post_one, put_all, put_one, etc). Merging current v2 into v1 should
> drastically decrease the number of changed lines in this patchset.
> I have so far found one fault in the URLs in our API that isn't easily
> handled by Pecan (some custom _route function would help) and IMHO
> should be fixed by rearranging URLs instead of adding _route hacks:
> /nodes/interfaces and /nodes/1/interfaces require the same get_all
> method in the interfaces controller. And /nodes/interfaces only usage is
> for doing a batch node interface update via PUT. The current v2 can be
> merged into v1 with some effort.
> We sometimes use a PUT request without specifying an object's ID -- this
> is unsupported in Pecan but can be easily hacked by giving a dummy
> keyword argument to function's definition:
> def put(self, dummy=None)
> Some bugs in tests were found and fixed (for example, wrong content-type
> in headers in ).
> I haven't put enough thought into error handling there yet, some stuff
> is implemented in hooks/error.py but I'm not fully satisfied with it.
> Most unfinished stuff I was marking with a TODO(pkaminski).
>  https://review.openstack.org/158661
>  https://review.openstack.org/#/c/99069/6
>  https://bugs.launchpad.net/fuel/+bug/1433528
More information about the OpenStack-dev