summaryrefslogtreecommitdiffstats
path: root/nova/compute
diff options
context:
space:
mode:
authorDan Prince <dprince@redhat.com>2012-08-15 12:01:12 -0400
committerDan Prince <dprince@redhat.com>2012-08-15 12:44:37 -0400
commita8024cd667b9d1a3aa5ce2fcfb6725b25ace9b6c (patch)
tree004801e3cf186fc35371d1c054f7ec9848fa6cc1 /nova/compute
parent35c12feb8c9467b9b4a7eac7a3f3d63bd620a35b (diff)
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
Diffstat (limited to 'nova/compute')
-rw-r--r--nova/compute/api.py7
1 files changed, 7 insertions, 0 deletions
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):
"""