We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e2a2fd5 commit 279231fCopy full SHA for 279231f
src/Products/DataCollector/SshClient.py
@@ -27,7 +27,7 @@
27
transport,
28
userauth,
29
)
30
-from twisted.conch.ssh.keys import Key
+from twisted.conch.ssh.keys import BadKeyError, Key
31
from twisted.internet import defer, reactor
32
from zope.component import queryUtility
33
from Products.ZenCollector.interfaces import IEventService
@@ -390,7 +390,7 @@ def _getKey(self):
390
try:
391
data = "".join(open(keyPath).readlines()).strip()
392
key = Key.fromString(data, passphrase=self.factory.password)
393
- except IOError as ex:
+ except (BadKeyError, IOError) as ex:
394
message = "Unable to read the SSH key file because %s" % ex
395
log.warn(message)
396
device = "localhost" # Fallback
0 commit comments