2
0
mirror of https://opendev.org/x/pyghmi synced 2025-01-16 04:38:19 +00:00

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
This commit is contained in:
Jarrod Johnson 2014-02-14 08:34:05 -05:00
parent 6e58eae301
commit 9eb13b9f8c

View File

@ -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