From a8024cd667b9d1a3aa5ce2fcfb6725b25ace9b6c Mon Sep 17 00:00:00 2001 From: Dan Prince Date: Wed, 15 Aug 2012 12:01:12 -0400 Subject: Add get_key_pair to compute API. This will be used to implement a GET keypair API call. Partial fix for LP Bug #925731. Change-Id: Ie9976c0168842c7491d80be6213814192a2024df --- nova/compute/api.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'nova/compute') diff --git a/nova/compute/api.py b/nova/compute/api.py index 2d62c00ed..e59b400ad 100644 --- a/nova/compute/api.py +++ b/nova/compute/api.py @@ -2062,6 +2062,13 @@ class KeypairAPI(base.Base): }) return rval + def get_key_pair(self, context, user_id, key_name): + """Get a keypair by name.""" + key_pair = self.db.key_pair_get(context, user_id, key_name) + return {'name': key_pair['name'], + 'public_key': key_pair['public_key'], + 'fingerprint': key_pair['fingerprint']} + class SecurityGroupAPI(base.Base): """ -- cgit