From 9eb13b9f8c8621565641ed64aaa4eb89f31a28de Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Fri, 14 Feb 2014 08:34:05 -0500 Subject: [PATCH] Fix large paste to SOL session While pyghmi was recording the maximum size the BMC advertised as accepting, it was not honoring it. Correct this by having the sendpendingpayload function only send the first 'self.maxoutcount' bytes. This actually turns into a loop because the ACK coming back for the chunk of data triggers a send of pending data, which includes the leftovers of the last attempt. Change-Id: I8e443e08a6eb4ed89eb74412cca92e2138cf9d00 --- pyghmi/ipmi/console.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/pyghmi/ipmi/console.py b/pyghmi/ipmi/console.py index 92be4751..28514fc4 100644 --- a/pyghmi/ipmi/console.py +++ b/pyghmi/ipmi/console.py @@ -154,8 +154,13 @@ class Console(object): return session.Session.wait_for_rsp(timeout=timeout) def _sendpendingoutput(self): - self._sendoutput(self.pendingoutput) - self.pendingoutput = "" + if len(self.pendingoutput) > self.maxoutcount: + chunk = self.pendingoutput[:self.maxoutcount] + self.pendingoutput = self.pendingoutput[self.maxoutcount:] + else: + chunk = self.pendingoutput + self.pendingoutput = "" + self._sendoutput(chunk) def _sendoutput(self, output): self.myseq += 1