From 5f4689935813064b4856b69c5b6fcd192b8a60fe Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Mon, 8 Oct 2018 16:51:58 -0400 Subject: [PATCH] Prevent clear_configuration from invaliding existing ConfigManager Clear out the existing dictionary instead of replacing it. This prevents configmanager objects from being stuck. --- confluent_server/confluent/config/configmanager.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/confluent_server/confluent/config/configmanager.py b/confluent_server/confluent/config/configmanager.py index 0e105c29..bc114426 100644 --- a/confluent_server/confluent/config/configmanager.py +++ b/confluent_server/confluent/config/configmanager.py @@ -638,7 +638,10 @@ def clear_configuration(): stop_following() _oldcfgstore = _cfgstore _oldtxcount = _txcount - _cfgstore = {} + if _cfgstore is None or 'main' not in _cfgstore: + _cfgstore = {} + else: + _cfgstore['main'].clear() _txcount = 0 def commit_clear():