diff --git a/pyghmi/ipmi/private/session.py b/pyghmi/ipmi/private/session.py index 1a34c7ef..db9eef79 100644 --- a/pyghmi/ipmi/private/session.py +++ b/pyghmi/ipmi/private/session.py @@ -540,6 +540,7 @@ class Session(object): def _mark_broken(self, error=None): # since our connection has failed retries # deregister our keepalive facility + self.lastpayload = none with util.protect(KEEPALIVE_SESSIONS): Session.keepalive_sessions.pop(self, None) with util.protect(WAITING_SESSIONS): @@ -699,6 +700,8 @@ class Session(object): stillin = self.incommand - _monotonic_time() if stillin > 0: return stillin + else: + self.lastpayload = None return 0 def _getmaxtimeout(self): @@ -1655,6 +1658,7 @@ class Session(object): self._mark_broken() return elif self.sessioncontext == 'FAILED': + self.lastpayload = None self.nowait = False return if self.sessioncontext == 'OPENSESSION': @@ -1746,6 +1750,7 @@ class Session(object): struct.pack("I", self.sessionid)), retry=False) # stop trying for a keepalive, + self.lastpayload = None with util.protect(KEEPALIVE_SESSIONS): Session.keepalive_sessions.pop(self, None) self.logged = 0