REST API requests not working because of incorrect url

Bug #1635570 reported by Martins Jakubovics
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Designate Dashboard
Fix Released
Undecided
Enrique
designate-dashboard (Ubuntu)
Confirmed
Undecided
Enrique

Bug Description

REST API requests not working because of incorrect URL.
Looks like missing trailing slash between endpoint and version. Fast fix is to add trailing slash in designatedashboard/api/rest/passthrough.py line 45:

_get_service_url(request, service) + '/' + url,

Probably this is working if endpoint are set with trailing slash at end.

Error trace:

[21/Oct/2016 08:19:29] "GET /api/dns/v2/zones/ HTTP/1.1" 500 46
HTTP exception with no status/code
Traceback (most recent call last):
  File "/home/martins/Documents/horizon/openstack_dashboard/api/rest/utils.py", line 126, in _wrapped
    data = function(self, request, *args, **kw)
  File "/home/martins/Documents/horizon/.venv/local/lib/python2.7/site-packages/designatedashboard/api/rest/passthrough.py", line 95, in get
    return passthrough_get(path, request).json()
  File "/home/martins/Documents/horizon/.venv/local/lib/python2.7/site-packages/designatedashboard/api/rest/passthrough.py", line 49, in _passthrough_request
    params=params
  File "/home/martins/Documents/horizon/.venv/local/lib/python2.7/site-packages/requests/api.py", line 70, in get
    return request('get', url, params=params, **kwargs)
  File "/home/martins/Documents/horizon/.venv/local/lib/python2.7/site-packages/requests/api.py", line 56, in request
    return session.request(method=method, url=url, **kwargs)
  File "/home/martins/Documents/horizon/.venv/local/lib/python2.7/site-packages/requests/sessions.py", line 461, in request
    prep = self.prepare_request(req)
  File "/home/martins/Documents/horizon/.venv/local/lib/python2.7/site-packages/requests/sessions.py", line 394, in prepare_request
    hooks=merge_hooks(request.hooks, self.hooks),
  File "/home/martins/Documents/horizon/.venv/local/lib/python2.7/site-packages/requests/models.py", line 294, in prepare
    self.prepare_url(url, params)
  File "/home/martins/Documents/horizon/.venv/local/lib/python2.7/site-packages/requests/models.py", line 348, in prepare_url
    raise InvalidURL(*e.args)
InvalidURL: Failed to parse: dns.example.lv:9001v2

Enrique (engapa)
Changed in designate-dashboard:
assignee: nobody → Enrique (engapa)
status: New → Confirmed
Changed in designate-dashboard (Ubuntu):
assignee: nobody → Enrique (engapa)
status: New → Confirmed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/designate-dashboard 4.0.0.0b3

This issue was fixed in the openstack/designate-dashboard 4.0.0.0b3 development milestone.

Changed in designate-dashboard:
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.