Getting the versions of the API fails
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
zaqar |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
so, doing a simple curl <host>:8888 fails with the following message to the client:
$ curl 192.0.2.1:8888
{
"title": "Internal server error",
"description": "LooseVersion instance has no attribute 'version'"
}
The following stack-trace can be seen in the zaqar logs:
2016-08-04 06:42:44.595 3363 ERROR zaqar.transport
2016-08-04 06:42:44.595 3363 ERROR zaqar.transport
2016-08-04 06:42:44.595 3363 ERROR zaqar.transport
2016-08-04 06:42:44.595 3363 ERROR zaqar.transport
2016-08-04 06:42:44.595 3363 ERROR zaqar.transport
2016-08-04 06:42:44.595 3363 ERROR zaqar.transport
2016-08-04 06:42:44.595 3363 ERROR zaqar.transport
2016-08-04 06:42:44.595 3363 ERROR zaqar.transport
2016-08-04 06:42:44.595 3363 ERROR zaqar.transport
2016-08-04 06:42:44.595 3363 ERROR zaqar.transport
2016-08-04 06:42:44.595 3363 ERROR zaqar.transport
2016-08-04 06:42:44.595 3363 ERROR zaqar.transport
2016-08-04 06:42:44.595 3363 ERROR zaqar.transport
2016-08-04 06:42:44.595 3363 ERROR zaqar.transport
This is because we try to get a version from the request's path, even if it doesn't need to be there, which is the case of the versions endpoint (or the / endpoint).
On the other hand, it seems that zaqar always checks for the project-id. Which is appropriate for all versions (or routes) except the root one.
Reviewed: https:/ /review. openstack. org/351039 /git.openstack. org/cgit/ openstack/ zaqar/commit/ ?id=cf6210df07d c29cb952d33f9d6 5cec8b49b04718
Committed: https:/
Submitter: Jenkins
Branch: master
commit cf6210df07dc29c b952d33f9d65cec 8b49b04718
Author: Juan Antonio Osorio Robles <email address hidden>
Date: Thu Aug 4 10:20:35 2016 +0300
Don't check for project-id if accessing the / route
The versions route (or / route) should be publicly accessible and is
used for keystone discovery. We shouldn't be checking for the
project-id if that's accessed. On the other hand, this also fixes the
issue where the server crashes if no version is given.
Change-Id: I0481ef6f3920c8 ee56ea79ed56212 06246b26299
Closes-Bug: #1609662