Exception when we receive an HTTP 4xx response

Bug #1642865 reported by David TARDIVEL
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
watcher-dashboard
Fix Released
Medium
David TARDIVEL

Bug Description

Traceback (most recent call last):
  File "/opt/.virtualenvs/horizon/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 132, in get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/opt/horizon/horizon/decorators.py", line 36, in dec
    return view_func(request, *args, **kwargs)
  File "/opt/horizon/horizon/decorators.py", line 52, in dec
    return view_func(request, *args, **kwargs)
  File "/opt/horizon/horizon/decorators.py", line 36, in dec
    return view_func(request, *args, **kwargs)
  File "/opt/.virtualenvs/horizon/local/lib/python2.7/site-packages/django/views/generic/base.py", line 71, in view
    return self.dispatch(request, *args, **kwargs)
  File "/opt/.virtualenvs/horizon/local/lib/python2.7/site-packages/django/views/generic/base.py", line 89, in dispatch
    return handler(request, *args, **kwargs)
  File "/opt/.virtualenvs/horizon/local/lib/python2.7/site-packages/django/views/generic/edit.py", line 215, in post
    return self.form_valid(form)
  File "/opt/horizon/horizon/forms/views.py", line 180, in form_valid
    exceptions.handle(self.request)
  File "/opt/horizon/horizon/exceptions.py", line 354, in handle
    six.reraise(exc_type, exc_value, exc_traceback)
  File "/opt/horizon/horizon/forms/views.py", line 177, in form_valid
    handled = form.handle(self.request, form.cleaned_data)
  File "/home/indeed/watcher-dashboard/watcher_dashboard/content/audits/forms.py", line 98, in handle
    if exc.status_code == 409:
AttributeError: 'BadRequest' object has no attribute 'status_code'

status_code does not exist. We should use http_status

ipdb> exc.
exc.args exc.details exc.http_status exc.message exc.method exc.request_id exc.response exc.url

Another error:

Traceback (most recent call last):
  File "/opt/.virtualenvs/horizon/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 132, in get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/opt/horizon/horizon/decorators.py", line 36, in dec
    return view_func(request, *args, **kwargs)
  File "/opt/horizon/horizon/decorators.py", line 52, in dec
    return view_func(request, *args, **kwargs)
  File "/opt/horizon/horizon/decorators.py", line 36, in dec
    return view_func(request, *args, **kwargs)
  File "/opt/.virtualenvs/horizon/local/lib/python2.7/site-packages/django/views/generic/base.py", line 71, in view
    return self.dispatch(request, *args, **kwargs)
  File "/opt/.virtualenvs/horizon/local/lib/python2.7/site-packages/django/views/generic/base.py", line 89, in dispatch
    return handler(request, *args, **kwargs)
  File "/opt/.virtualenvs/horizon/local/lib/python2.7/site-packages/django/views/generic/edit.py", line 215, in post
    return self.form_valid(form)
  File "/opt/horizon/horizon/forms/views.py", line 180, in form_valid
    exceptions.handle(self.request)
  File "/opt/horizon/horizon/exceptions.py", line 354, in handle
    six.reraise(exc_type, exc_value, exc_traceback)
  File "/opt/horizon/horizon/forms/views.py", line 177, in form_valid
    handled = form.handle(self.request, form.cleaned_data)
  File "/home/indeed/watcher-dashboard/watcher_dashboard/content/audits/forms.py", line 100, in handle
    msg = _('Failed to create audit "%s".') % data['name']
KeyError: 'name'

description: updated
Changed in watcher-dashboard:
status: New → Confirmed
milestone: none → ocata-2
tags: added: low-hanging-fruit
Changed in watcher-dashboard:
assignee: nobody → David TARDIVEL (david-tardivel)
importance: Undecided → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/watcher-dashboard 0.8.0

This issue was fixed in the openstack/watcher-dashboard 0.8.0 release.

Changed in watcher-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.