summaryrefslogtreecommitdiff
path: root/nova/crypto.py
diff options
context:
space:
mode:
authorMark McLoughlin <markmc@redhat.com>2013-09-16 11:50:35 -0700
committerMark McLoughlin <markmc@redhat.com>2013-09-16 13:15:12 -0700
commit82910812cbb9b27e747b972d6727d0c2cdd25d83 (patch)
tree7a627c3778437ea6a00a9ff9d434ee5716d2d4a0 /nova/crypto.py
parentf11dc6b3bc315c11fb3a6055f7f53386c8eb888d (diff)
downloadnova-82910812cbb9b27e747b972d6727d0c2cdd25d83.tar.gz
Improve "keypair data is invalid" error message
When doing a keypair-add, I was hitting a permission denied issue with ssh-keygen -l. This turned out to be a configuration issue, but the error message on the client side was pretty unhelpful with debugging the issue: BadRequest: Keypair data is invalid (HTTP 400) Fix that so we get: BadRequest: Keypair data is invalid: failed to generate fingerprint (HTTP 400) Also fix the other uses of InvalidKeypair so we include the general "keypair data is invalid" prefix. Change-Id: I209e76adaf7c18a9f2f2dbb6da62db6c1cd9461e
Diffstat (limited to 'nova/crypto.py')
-rw-r--r--nova/crypto.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/nova/crypto.py b/nova/crypto.py
index ca196cc547..5f3a24e307 100644
--- a/nova/crypto.py
+++ b/nova/crypto.py
@@ -141,7 +141,8 @@ def generate_fingerprint(public_key):
f.write(public_key)
return _generate_fingerprint(pubfile)
except processutils.ProcessExecutionError:
- raise exception.InvalidKeypair()
+ raise exception.InvalidKeypair(
+ reason=_('failed to generate fingerprint'))
def generate_key_pair(bits=None):