local variable 'keypair' referenced before assignment
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Dashboard (Horizon) |
Fix Released
|
Medium
|
Ana Krivokapić |
Bug Description
When a user that isn't allowed to create a keypair tries to create one through the Horizon dashboard, a back trace is displayed instead of the usual nice error message.
Details:
Environment:
Request Method: GET
Request URL: http://
Django Version: 1.6.2
Python Version: 2.7.3
Installed Applications:
['openstack_
'openstack_
'openstack_
'openstack_
'django.
'django.
'django.
'django.
'django.
'django.
'compressor',
'horizon',
'openstack_auth']
Installed Middleware:
('django.
'django.
'django.
'django.
'django.
'horizon.
'django.
'django.
'django.
Traceback:
File "/usr/local/
114. response = wrapped_
File "/opt/stack/
38. return view_func(request, *args, **kwargs)
File "/opt/stack/
54. return view_func(request, *args, **kwargs)
File "/opt/stack/
38. return view_func(request, *args, **kwargs)
File "/usr/local/
69. return self.dispatch(
File "/usr/local/
87. return handler(request, *args, **kwargs)
File "/opt/stack/
78. 'attachment; filename=%s.pem' % slugify(
Exception Type: UnboundLocalError at /project/
Exception Value: local variable 'keypair' referenced before assignment
Changed in horizon: | |
assignee: | nobody → Ana Krivokapić (akrivoka) |
Changed in horizon: | |
status: | Fix Committed → Fix Released |
Changed in horizon: | |
milestone: | juno-1 → 2014.2 |
I think this will be partially fixed with the Nova RBAC patch in Icehouse ( https:/ /blueprints. launchpad. net/horizon/ +spec/compute- rbac ), the action button won't be shown if the action isn't allowed.
However we should still fail more gracefully in the meantime, the exception message indicates an initialisation error in the code. We should make sure the redirect happens in the exception, I think https:/ /github. com/openstack/ horizon/ blob/1fdac75d4f /openstack_ dashboard/ dashboards/ project/ access_ and_security/ keypairs/ views.py# L70