2
0
mirror of https://github.com/xcat2/confluent.git synced 2025-01-17 13:13:18 +00:00

Fix more usage mistakes

This commit is contained in:
Jarrod Johnson 2016-02-11 12:08:18 -05:00
parent 824253ae8c
commit 774d592eb4
2 changed files with 6 additions and 4 deletions

View File

@ -42,7 +42,8 @@ class HostKeyHandler(paramiko.client.MissingHostKeyPolicy):
cfg[self.node]['pubkeys.addpolicy'] and
cfg[self.node]['pubkeys.addpolicy']['value'] == 'manual'):
raise cexc.PubkeyInvalid('New ssh key detected',
key, fingerprint, 'pubkeys.ssh')
key.asbytes(), fingerprint,
'pubkeys.ssh')
auditlog = log.Logger('audit')
auditlog.log({'node': self.node, 'event': 'sshautoadd',
'fingerprint': fingerprint})
@ -51,8 +52,9 @@ class HostKeyHandler(paramiko.client.MissingHostKeyPolicy):
return True
elif cfg[self.node]['pubkeys.ssh']['value'] == fingerprint:
return True
raise cexc.PubKeyInvalid(
'Mismatched SSH host key detected', key, fingerprint, 'pubkeys.ssh'
raise cexc.PubkeyInvalid(
'Mismatched SSH host key detected', key.asbytes(), fingerprint,
'pubkeys.ssh'
)

View File

@ -93,6 +93,6 @@ class TLSCertVerifier(object):
return True
elif storedprint[self.node][self.fieldname]['value'] == fingerprint:
return True
raise cexc.PubKeyInvalid(
raise cexc.PubkeyInvalid(
'Mismatched certificate detected', certificate, fingerprint,
self.fieldname)