From 42c04229301a86873a0e7c4e5891e011fcfdd032 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Wed, 19 Apr 2017 14:54:42 -0400 Subject: [PATCH] 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 --- pyghmi/ipmi/private/session.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyghmi/ipmi/private/session.py b/pyghmi/ipmi/private/session.py index 4a0f4233..a9945d08 100644 --- a/pyghmi/ipmi/private/session.py +++ b/pyghmi/ipmi/private/session.py @@ -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()