Skip to content

Instantly share code, notes, and snippets.

@treshenry
Created November 17, 2011 21:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save treshenry/1374616 to your computer and use it in GitHub Desktop.
Save treshenry/1374616 to your computer and use it in GitHub Desktop.
Traceback (most recent call last):
File "/opt/stack/horizon/openstack-dashboard/.dashboard-venv/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 111, in get_response
response = callback(request, *callback_args, **callback_kwargs)
File "/opt/stack/horizon/horizon/horizon/decorators.py", line 41, in dec
return view_func(request, *args, **kwargs)
File "/opt/stack/horizon/horizon/horizon/decorators.py", line 41, in dec
return view_func(request, *args, **kwargs)
File "/opt/stack/horizon/openstack-dashboard/.dashboard-venv/local/lib/python2.7/site-packages/django/contrib/auth/decorators.py", line 23, in _wrapped_view
return view_func(request, *args, **kwargs)
File "/opt/stack/horizon/horizon/horizon/dashboards/nova/keypairs/views.py", line 52, in index
keypairs = api.keypair_list(request)
File "/opt/stack/horizon/horizon/horizon/api/nova.py", line 218, in keypair_list
return [KeyPair(key) for key in novaclient(request).keypairs.list()]
File "/opt/stack/horizon/horizon/horizon/api/nova.py", line 144, in novaclient
auth_url=url_for(request, 'compute'))
TypeError: __init__() got an unexpected keyword argument 'api_key'
[17/Nov/2011 13:37:24] "GET /nova/keypairs/ HTTP/1.1" 500 109855
@MartinPaulo
Copy link

I've run into a similar error: and as someone new to the code am wondering if the required changes to fix this are flowing from horizon->novaclient or in the opposite direction?
My error is on line 381 of https://github.com/openstack/horizon/blob/stable/diablo/django-openstack/django_openstack/api.py and if I change it to match the expect argument list in https://github.com/rackspace/python-novaclient/blob/master/novaclient/v1_1/client.py Client init
(ie api_key=request.user.token becomes password=request.user.token ) everything seems to work in harmony, sweetness and light...

Looking at the above stack trace I am guessing that the above error is similar to mine, but not the same :-(

And here is the bug that is affecting me:
https://bugs.launchpad.net/horizon/+bug/891442

@treshenry
Copy link
Author

This is patched in the latest python-novaclient so the quick workaround is to upgrade in the Horizon venv:

tools/with_venv.sh pip install python-novaclient --upgrade

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment