CLI sends parameters in the query string for idempotent operations
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
MAAS |
Fix Released
|
Critical
|
Gavin Panella |
Bug Description
However, the back-end only expects parameters in the query string for GET requests. The other supported HTTP methods - POST, PUT, DELETE - look for parameters in the request body. This bug causes PUT and DELETE requests from finding the parameters they expect.
There's nothing to prevent looking in the query string, or in both the query string and request body, but it just doesn't seem to be the way that Piston/Django/MAAS are wired. In part I blame the misleading convention that has arisen where parameters in the query string are referred to as "GET" parameters, and those in the body are "POST" parameters.
The simplest solution here seems to be to get the CLI to only send parameters in the query string for GET requests, and otherwise encode them in the message body.
Related branches
- Raphaël Badin (community): Approve
-
Diff: 280 lines (+146/-71)2 files modifiedsrc/maascli/api.py (+18/-22)
src/maascli/tests/test_api.py (+128/-49)
Changed in maas: | |
status: | Triaged → In Progress |
assignee: | nobody → Gavin Panella (allenap) |
Changed in maas: | |
status: | In Progress → Fix Released |
This might be the root cause for bug 1057854