Comment 2 for bug 1996507

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to distcloud (master)

Reviewed: https://review.opendev.org/c/starlingx/distcloud/+/864414
Committed: https://opendev.org/starlingx/distcloud/commit/00f5a5361151b279dea7a932f74afb1465483800
Submitter: "Zuul (22348)"
Branch: master

commit 00f5a5361151b279dea7a932f74afb1465483800
Author: Gustavo Herzmann <email address hidden>
Date: Mon Nov 14 11:05:52 2022 -0300

    Fix subcloud-group endpoint routing conflict

    Pecan default routing algorithm fails to find the requested resource
    when the requested URL contains keywords that match the name of any
    method declared inside of a pecan controller decorated with the
    @expose(generic=True, ...) or @index.when() decorators.

    This commit implements a custom routing through the use of pecan's
    _route() method, where the routing is redirected to the generic index
    method, allowing the keywords to be correctly passed as arguments to
    the correct method handler based on the request method (GET, POST,
    PATCH, DELETE, etc.).

    Test plan:
    PASS: Execute all of the subcloud-group sub-commands (add, delete, list,
    list-subclouds, show and update) with the following group names: get,
    post, patch, delete, index, _validate_name, _route and foo.

    Closes-Bug: #1996507

    Signed-off-by: Gustavo Herzmann <email address hidden>
    Change-Id: I98a22f2bf1da205b68ee4199fb339776dd3d8dde