diff options
| author | Jenkins <jenkins@review.openstack.org> | 2012-01-30 17:14:56 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2012-01-30 17:14:56 +0000 |
| commit | c10443704226341086d3d1cd8850508d28201fc3 (patch) | |
| tree | 29e61acca568bf890a56d74918b786f2e75c60d1 /nova/api | |
| parent | e372ec0b98269aeef99f73b98319b6876c33b7b1 (diff) | |
| parent | 271acd8a0434a1e23d29df26cb1a211d1c28d8cf (diff) | |
Merge "Handle kepair delete when not found"
Diffstat (limited to 'nova/api')
| -rw-r--r-- | nova/api/openstack/compute/contrib/keypairs.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/nova/api/openstack/compute/contrib/keypairs.py b/nova/api/openstack/compute/contrib/keypairs.py index 512f8660a..57ac48dbc 100644 --- a/nova/api/openstack/compute/contrib/keypairs.py +++ b/nova/api/openstack/compute/contrib/keypairs.py @@ -17,11 +17,8 @@ """ Keypair management extension""" -import os -import shutil -import tempfile - import webob +import webob.exc from nova.api.openstack import wsgi from nova.api.openstack import xmlutil @@ -122,7 +119,10 @@ class KeypairController(object): """ context = req.environ['nova.context'] authorize(context) - db.key_pair_destroy(context, context.user_id, id) + try: + db.key_pair_destroy(context, context.user_id, id) + except exception.KeypairNotFound: + raise webob.exc.HTTPNotFound() return webob.Response(status_int=202) @wsgi.serializers(xml=KeypairsTemplate) |
