renaming of api_key causes several unhandled exceptions

Bug #891442 reported by Andrew Bogott
20
This bug affects 3 people
Affects Status Importance Assigned to Milestone
OpenStack Dashboard (Horizon)
Fix Released
Critical
Jesse Andrews
python-novaclient
Fix Released
Undecided
Chris Behrens

Bug Description

On the stable/diablo branch, several dashboard features are broken due to an unexpected argument, 'api_key'. This argument appears to have been renamed to 'password' in python-novaclient.

Attached patch resolves the issue.

Revision history for this message
Andrew Bogott (andrewbogott) wrote :
Revision history for this message
Jesse Andrews (anotherjesse) wrote :

The rename does fix it, but I think the real issue is that we shouldn't be sending the auth_token in as "password"

Changed in horizon:
status: New → Confirmed
importance: Undecided → Critical
milestone: none → diablo-integrated-freeze
Revision history for this message
Jesse Andrews (anotherjesse) wrote :
Revision history for this message
Jesse Andrews (anotherjesse) wrote :

perhaps we should not used named parameters?

Revision history for this message
Jesse Andrews (anotherjesse) wrote :

Should we roll back the nova-client change (just of the named parameters for that function) until a patch like this is released?

Revision history for this message
Chris Behrens (cbehrens) wrote :

Hm. It does seem like callers should not use keyword arguments, since they are not optional...

If it helps, I'm okay renaming the argument back for a while.

Revision history for this message
Chris Behrens (cbehrens) wrote :

ALSO: NOVA_API_KEY environment variable changed to NOVA_PASSWORD... which is incompatible with the novarc template in nova diablo... and even still in nova master. Suspect I might need to revert the patchset that made these changes.

Revision history for this message
Gabriel Hurley (gabriel-hurley) wrote :

There is a conflation of password and api_key in novaclient which is inappropriate. If you take a look at python-keystoneclient, I actually separated the two because there are cases (at least in keystone) where they need to be handled differently.

Positional arguments are easier for making things "required" but also get ugly for backwards compatibility across changes to the function signature. Keyword arguments are both easier to work with (you don't have to memorize the order) and more forwards-compatible. If you want t make them required, just raise a ValueError if a required keyword argument is present.

Revision history for this message
Chris Behrens (cbehrens) wrote :

Gabriel: Sure. I just want to get some sort of fix in ASAP and we can figure out the right thing afterwards.

Jesse: https://review.openstack.org/#change,1734

Changed in python-novaclient:
assignee: nobody → Chris Behrens (cbehrens)
status: New → In Progress
Revision history for this message
Openstack Gerrit (openstack-gerrit) wrote : Fix merged to python-novaclient (master)

Reviewed: https://review.openstack.org/1734
Committed: http://github.com/openstack/python-novaclient/commit/0e1e38d2e43fddb90b8010bd3e43b3da641cf643
Submitter: Jenkins
Branch: master

 status fixcommitted
 done

commit 0e1e38d2e43fddb90b8010bd3e43b3da641cf643
Author: Chris Behrens <email address hidden>
Date: Thu Nov 17 12:48:58 2011 -0800

    Revert api_key change in novaclient Client argument

    Fixes bug 891442

    Also, still need to support NOVA_API_KEY environment variable for now.
    Bump version to 2.6.8 so we can get this into pypi
    Updated setup.py to build properly

    Change-Id: I16233ac559bf44b78666118d68975509da6bfb0d

Revision history for this message
Chris Behrens (cbehrens) wrote :

And I just pushed novaclient version 2.6.8 to pypi.

Changed in python-novaclient:
status: In Progress → Fix Committed
Revision history for this message
Jesse Andrews (anotherjesse) wrote :

should horizon go ahead and switch to positional parameters for this call so we can revert the revert eventually?

Revision history for this message
Chris Behrens (cbehrens) wrote :

I think so... or we can wait to figure out what the novaclient interface really should be. Passing in password or auth_token as keyword arguments might certainly be appealing if there ends up being different functionality based on which one is passed.

Devin Carlen (devcamcar)
Changed in horizon:
assignee: nobody → anotherjesse (anotherjesse)
Thierry Carrez (ttx)
affects: python-novaclient → nova
tags: added: python-novaclient
Thierry Carrez (ttx)
Changed in nova:
milestone: none → essex-2
status: Fix Committed → Fix Released
Revision history for this message
Gabriel Hurley (gabriel-hurley) wrote :

Whatever happened here, this has been long-since resolved and is no longer an issue.

Changed in horizon:
milestone: diablo-integrated-freeze → none
status: Confirmed → Fix Committed
Thierry Carrez (ttx)
Changed in horizon:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: essex-2 → 2012.1
Thierry Carrez (ttx)
affects: nova → python-novaclient
Changed in python-novaclient:
milestone: 2012.1 → none
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.