2
0
mirror of https://github.com/xcat2/confluent.git synced 2024-12-25 12:41:39 +00:00

Fix ssh disconnect handling in python 3

In python 3, '' will never match b''. Just
use the value as a boolean to catch either ''
or b''.
This commit is contained in:
Jarrod Johnson 2020-07-15 10:33:28 -04:00
parent 3b121cdb4b
commit 81835d66be

View File

@ -99,7 +99,7 @@ class SshShell(conapi.Console):
def recvdata(self):
while self.connected:
pendingdata = self.shell.recv(8192)
if pendingdata == '':
if not pendingdata:
self.datacallback(conapi.ConsoleEvent.Disconnect)
return
self.datacallback(pendingdata)