From f4cf74b699248730734f3e1618f6a29d9f4fdf4c Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Thu, 31 Jan 2019 14:28:45 -0500 Subject: [PATCH] Fix modifying dictionary while iterating Need to make a stable value before iterating to delete. --- confluent_server/confluent/networking/macmap.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/confluent_server/confluent/networking/macmap.py b/confluent_server/confluent/networking/macmap.py index ec4759c6..2522a030 100644 --- a/confluent_server/confluent/networking/macmap.py +++ b/confluent_server/confluent/networking/macmap.py @@ -342,7 +342,7 @@ def _full_updatemacmap(configmanager): _switchportmap[curswitch][portname] = None else: _switchportmap[curswitch][portname] = node - for switch in _macsbyswitch: + for switch in list(_macsbyswitch): if switch not in switches: del _macsbyswitch[switch] switchauth = get_switchcreds(configmanager, switches)