Generate clear error message for invalid unencrypted key
This commit is contained in:
+5
-4
@@ -81,10 +81,11 @@ class PrivateKey(object):
|
|||||||
raise InvalidValueError('Need a password to decrypt the key.')
|
raise InvalidValueError('Need a password to decrypt the key.')
|
||||||
except paramiko.SSHException as exc:
|
except paramiko.SSHException as exc:
|
||||||
logging.error(str(exc))
|
logging.error(str(exc))
|
||||||
raise InvalidValueError(
|
msg = 'Invalid key'
|
||||||
'Invalid key or wrong password "{}" for decrypting it.'
|
if self.password:
|
||||||
.format(self.password)
|
msg += ' or wrong password "{}" for decrypting it.'.format(
|
||||||
)
|
self.password)
|
||||||
|
raise InvalidValueError(msg)
|
||||||
|
|
||||||
|
|
||||||
class MixinHandler(object):
|
class MixinHandler(object):
|
||||||
|
|||||||
Reference in New Issue
Block a user