compute API's KeyPairExists errors cause KeyError to be logged

Bug #1022611 reported by Dan Prince
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Low
Dan Prince

Bug Description

When trying to create two keypairs of the same name I see the following log ERROR in Nova's api.log file:

ST http://localhost:8774/v1.1/53853d16a41d4b3682bc3c0ae19e7101/os-keypairs
2012-07-09 15:28:20 ERROR nova.exception [req-e8af3a90-9b5e-4888-9d33-c17e30cbd94b db25e87ae8ac4d58b875a300c6415221 53853d16a41d4b3682bc3c0ae19e7101] Exception in string format operation
2012-07-09 15:28:20 TRACE nova.exception Traceback (most recent call last):
2012-07-09 15:28:20 TRACE nova.exception File "/usr/lib/python2.7/site-packages/nova/exception.py", line 144, in __init__
2012-07-09 15:28:20 TRACE nova.exception message = self.message % kwargs
2012-07-09 15:28:20 TRACE nova.exception KeyError: u'key_name'
2012-07-09 15:28:20 TRACE nova.exception
2012-07-09 15:28:20 ERROR nova.exception [req-e8af3a90-9b5e-4888-9d33-c17e30cbd94b db25e87ae8ac4d58b875a300c6415221 53853d16a41d4b3682bc3c0ae19e7101] explanation: Key pair 'keypair-4181055872' already exists.

----

Looks like we need to ensure 'key_name' is passed to the KeyPairExists constructor.

Dan Prince (dan-prince)
Changed in nova:
assignee: nobody → Dan Prince (dan-prince)
importance: Undecided → Low
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/9522

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/9522
Committed: http://github.com/openstack/nova/commit/13fd37932452874f7dad7e4bb2230cf6f16073e7
Submitter: Jenkins
Branch: master

commit 13fd37932452874f7dad7e4bb2230cf6f16073e7
Author: Dan Prince <email address hidden>
Date: Mon Jul 9 11:40:10 2012 -0400

    Fix KeyError 'key_name' when KeyPairExists raised.

    Updates the Nova compute API to pass a key_name arg to the
    KeyPairExists constructor. This fixes an issue where a KeyError
    exception would get logged to Nova's api.log file if a KeyPairExists
    exception was thrown.

    Also removes the un-needed exception explanation argument from the
    KeyPairExists constructor.

    Fixes LP Bug #1022611

    Change-Id: I83ecf3d392fef97649b298d1b732e1ff51145ae4

Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
milestone: none → folsom-3
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: folsom-3 → 2012.2
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.