From 5ccfa36da6e2a2da558f9cc28487e819c3eeede8 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Wed, 15 Jul 2020 10:33:28 -0400 Subject: [PATCH] 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''. --- confluent_server/confluent/plugins/shell/ssh.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/confluent_server/confluent/plugins/shell/ssh.py b/confluent_server/confluent/plugins/shell/ssh.py index e97784eb..06da4ff7 100644 --- a/confluent_server/confluent/plugins/shell/ssh.py +++ b/confluent_server/confluent/plugins/shell/ssh.py @@ -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)