mirror of
https://opendev.org/x/pyghmi
synced 2025-01-27 19:37:44 +00:00
Fix error behavior when target has no SOL session
When a system did not have any custom keep alive, the code to mark the esssion broken erroneously tries to dereference. Change-Id: Ic4efe3c65ee4c09c97ef9f08dc30603c4c15d872
This commit is contained in:
parent
657b75cc86
commit
c35781d4cf
@ -496,14 +496,15 @@ class Session(object):
|
||||
if self.logged:
|
||||
self.logged = 0 # mark session as busted
|
||||
self.logging = False
|
||||
for ka in list(self._customkeepalives):
|
||||
if self._customkeepalives:
|
||||
for ka in list(self._customkeepalives):
|
||||
# Be thorough and notify parties through their custom
|
||||
# keepalives. In practice, this *should* be the same, but
|
||||
# if a code somehow makes duplicate SOL handlers,
|
||||
# this would notify all the handlers rather than just the
|
||||
# last one to take ownership
|
||||
self._customkeepalives[ka][1](
|
||||
{'error': 'Session Disconnected'})
|
||||
self._customkeepalives[ka][1](
|
||||
{'error': 'Session Disconnected'})
|
||||
self._customkeepalives = None
|
||||
if not self.broken:
|
||||
self.socketpool[self.socket] -= 1
|
||||
|
Loading…
x
Reference in New Issue
Block a user