mirror of
https://github.com/xcat2/confluent.git
synced 2024-11-26 11:30:23 +00:00
Have ssh plugin report on connection error
Before the connection would fail and log to trace without anything particularly informative for the client (they just saw 'unexpected error'. Provide a more informative behavior for the client.
This commit is contained in:
parent
58bf72d5aa
commit
c5e19fe474
@ -72,7 +72,6 @@ class SshShell(conapi.Console):
|
||||
while self.connected:
|
||||
pendingdata = self.shell.recv(8192)
|
||||
if pendingdata == '':
|
||||
self.datacallback(conapi.ConsoleEvent.Disconnect)
|
||||
return
|
||||
self.datacallback(pendingdata)
|
||||
|
||||
@ -103,6 +102,13 @@ class SshShell(conapi.Console):
|
||||
self.password = ''
|
||||
self.datacallback('\r\nlogin as: ')
|
||||
return
|
||||
except paramiko.ssh_exception.NoValidConnectionsError as e:
|
||||
self.datacallback(str(e))
|
||||
self.inputmode = 0
|
||||
self.username = ''
|
||||
self.password = ''
|
||||
self.datacallback('\r\nlogin as: ')
|
||||
return
|
||||
self.inputmode = 2
|
||||
self.connected = True
|
||||
self.shell = self.ssh.invoke_shell()
|
||||
|
Loading…
Reference in New Issue
Block a user