2
0
mirror of https://opendev.org/x/pyghmi synced 2026-05-13 18:04:19 +00:00

Correct pool usage count on failed login

If trying to establish a session and an error occurs, pyghmi
was not decrementing the usage count on the pool, leading for
more than expected filehandles being created over time.  Fix
this by correctly decrementing the count in the case where
something is not yet broken, but is also not yet logged in.

Change-Id: I1b27f9b3b902a253d38293182305cc4dac26b765
This commit is contained in:
Jarrod Johnson
2014-05-22 13:37:46 -04:00
parent ad934dc1e3
commit 9e31a70f5f
+3
View File
@@ -403,6 +403,9 @@ class Session(object):
del Session.bmc_handlers[sockaddr]
if self.sol_handler:
self.sol_handler({'error': 'Session Disconnected'})
elif not self.broken:
self.broken = True
self.socketpool[self.socket] -= 1
def onlogon(self, parameter):
if 'error' in parameter: