summaryrefslogtreecommitdiffstats
path: root/nova/api
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2012-06-06 23:21:25 +0000
committerGerrit Code Review <review@openstack.org>2012-06-06 23:21:25 +0000
commit7b7febb02b37420c759eab59b07c7e3e2de9bab1 (patch)
treeb44bbdbf8a64b3278a4ca091fc7c1e27ef5e3cb7 /nova/api
parent25b665d6ec966f3b27af56e2085dda0923728bd5 (diff)
parent29baa0ec661c2578ad0aabd138a6b84e5c7a0b40 (diff)
downloadnova-7b7febb02b37420c759eab59b07c7e3e2de9bab1.tar.gz
nova-7b7febb02b37420c759eab59b07c7e3e2de9bab1.tar.xz
nova-7b7febb02b37420c759eab59b07c7e3e2de9bab1.zip
Merge "Fix bug 1006664: describe non existent ec2 keypair"
Diffstat (limited to 'nova/api')
-rw-r--r--nova/api/ec2/cloud.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/nova/api/ec2/cloud.py b/nova/api/ec2/cloud.py
index 723c7fca7..6f0d605ed 100644
--- a/nova/api/ec2/cloud.py
+++ b/nova/api/ec2/cloud.py
@@ -337,6 +337,11 @@ class CloudController(object):
if not key_name is None:
key_pairs = [x for x in key_pairs if x['name'] in key_name]
+ #If looking for non existent key pair
+ if key_name != None and key_pairs == []:
+ msg = _('Could not find key pair(s): %s') % ','.join(key_name)
+ raise exception.EC2APIError(msg)
+
result = []
for key_pair in key_pairs:
# filter out the vpn keys