From c74b7ef0eeb99c76ed2bfee8e73c0298eb69c3be Mon Sep 17 00:00:00 2001 From: Jarrod Johnon Date: Thu, 22 Jan 2015 09:24:03 -0500 Subject: [PATCH] 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 --- pyghmi/ipmi/console.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pyghmi/ipmi/console.py b/pyghmi/ipmi/console.py index 993f8507..a580c258 100644 --- a/pyghmi/ipmi/console.py +++ b/pyghmi/ipmi/console.py @@ -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