2
0
mirror of https://opendev.org/x/pyghmi synced 2025-11-01 11:52:26 +00:00

Gracefully handle error while acking SOL

If SOL data comes in while trying to issue a command, the
caller had the risk of being bothered with unrelated execption
due to a failure to handle ack while waiting to send raw command.
If an exception occurs, silently mark the console object as closed
and move on.

Change-Id: I894d4f6596cf0546e8fe76ced0e309175198651d
This commit is contained in:
Jarrod Johnon
2015-01-22 09:24:03 -05:00
parent 7c90bc9efa
commit c74b7ef0ee

View File

@@ -325,7 +325,11 @@ class Console(object):
#Why not put pending data into the ack? because it's rare
#and might be hard to decide what to do in the context of
#retry situation
self.send_payload(ackpayload, retry=False)
try:
self.send_payload(ackpayload, retry=False)
except exc.IpmiException:
#if the session is broken, then close the SOL session
self.close()
if self.myseq != 0 and ackseq == self.myseq: # the bmc has something
# to say about last xmit
self.awaitingack = False