Current API controller design creates routes which shouldn't exist
Bug #1580997 reported by
Sam Betts
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Ironic |
Triaged
|
Medium
|
Unassigned |
Bug Description
The way that the pecan rest controller works means that any controllers defined as class attributes of the controller become sub-controllers of that controller. This is influences the URL routing created by pecan leading to some unexpected results when we enable using node names in the URLS:
class Nodes(RestContr
ports = PortsController()
leads to not only the routes:
nodes/<node id>/ports
but also
nodes/ports
nodes/ports is a route that doesn't mean anything to our API and actually causes collisions with node names, resulting in certain node names being disallowed. This can be fixed by writing our controllers using a different method.
Changed in ironic: | |
assignee: | nobody → Sam Betts (sambetts) |
Changed in ironic: | |
status: | New → In Progress |
Changed in ironic: | |
importance: | Undecided → High |
tags: | added: api |
Changed in ironic: | |
assignee: | Sam Betts (sambetts) → Vladyslav Drok (vdrok) |
Changed in ironic: | |
assignee: | Vladyslav Drok (vdrok) → Sam Betts (sambetts) |
Changed in ironic: | |
assignee: | Sam Betts (sambetts) → Michael Turek (mjturek) |
Changed in ironic: | |
assignee: | Michael Turek (mjturek) → Sam Betts (sambetts) |
Changed in ironic: | |
assignee: | Sam Betts (sambetts) → Michael Turek (mjturek) |
Changed in ironic: | |
assignee: | Michael Turek (mjturek) → Sam Betts (sambetts) |
To post a comment you must log in.
Reviewed: https:/ /review. openstack. org/314514 /git.openstack. org/cgit/ openstack/ ironic/ commit/ ?id=39e58151afc 205fcf10f23256d b123bc05007b8b
Committed: https:/
Submitter: Jenkins
Branch: master
commit 39e58151afc205f cf10f23256db123 bc05007b8b
Author: Sam Betts <email address hidden>
Date: Tue May 10 12:29:12 2016 +0100
Prevent URL collisions with sub-controllers: nodes/ports
This patch removes the route v1/nodes/ports by removing the ports
controllers from being a class attribute of the nodes controller, and
starts using the pecan _lookup function to process sub-resources.
Co-Authored-By: Vladyslav Drok <email address hidden> 9a000e61a215b2b 32fdd52fb37
Partial-Bug: #1580997
Change-Id: I1f76a5f2ea4562