mirror of
https://opendev.org/x/pyghmi
synced 2025-01-16 04:38:19 +00:00
Fix exception if login times out
If a client attempts connection to a BMC that is not there, unusual KeyError would get thrown. Correct this by only attempting to deregister the element if it is registered. Change-Id: I3febb92ae8bc40c2847758797f179e85d58d97b1
This commit is contained in:
parent
c18693ab3d
commit
ed220d6ebd
@ -256,7 +256,8 @@ class Session(object):
|
||||
# This allows constructor to create a new, functional object to
|
||||
# replace this one
|
||||
for sockaddr in self.allsockaddrs:
|
||||
del Session.bmc_handlers[sockaddr]
|
||||
if sockaddr in Session.bmc_handlers:
|
||||
del Session.bmc_handlers[sockaddr]
|
||||
if self.sol_handler:
|
||||
self.sol_handler({'error': 'Session Disconnected'})
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user