2
0
mirror of https://opendev.org/x/pyghmi synced 2025-01-27 19:37:44 +00:00

Fix cleanup loop of changing dictionary

The dictionary size can change, causing this loop to
fail.  Fix by wrapping the iterator in a list prior to
iterating.

Change-Id: I67dd5b8b69698e67d6fd07ab18114ce144999d7a
This commit is contained in:
Jarrod Johnson 2017-04-19 14:54:42 -04:00
parent b9b9620a9d
commit 42c0422930

View File

@ -288,7 +288,7 @@ class Session(object):
@classmethod
def _cleanup(cls):
for sesskey in cls.bmc_handlers:
for sesskey in list(cls.bmc_handlers):
session = cls.bmc_handlers[sesskey]
session.cleaningup = True
session.logout()