2
0
mirror of https://github.com/xcat2/confluent.git synced 2025-02-16 18:49:04 +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 5b1e144d32
commit 5ccfa36da6

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)