From 2115ed5c3bc34a092d640bb48d5c372041fbfd22 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Fri, 2 May 2014 13:36:06 -0400 Subject: [PATCH] Break session objects on keepalive failures If the keepalive fails, it was causing the library to spin on expired keepalive attempts. Call mark_broken in order to avoid that spinning. Change-Id: I1c7a06ebf7609989ebd6e90d26ac69f3fe7b8699 --- pyghmi/ipmi/private/session.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pyghmi/ipmi/private/session.py b/pyghmi/ipmi/private/session.py index d91f5304..55e5cb2b 100644 --- a/pyghmi/ipmi/private/session.py +++ b/pyghmi/ipmi/private/session.py @@ -934,7 +934,10 @@ class Session(object): """ if self.incommand: # if currently in command, no cause to keepalive return - self.raw_command(netfn=6, command=1) + try: + self.raw_command(netfn=6, command=1) + except exc.IpmiException: + self._mark_broken() @classmethod def _route_ipmiresponse(cls, sockaddr, data):