From c2115f4df9494d51895e90fdaa1a08723c836bb1 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Thu, 29 Jun 2017 13:08:23 -0400 Subject: [PATCH] Fix get/set global with the stateless mode change Since supporting stateless made the init() optional, the *_global functions would not work if called first. Correct this oversight. --- confluent_server/confluent/config/configmanager.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/confluent_server/confluent/config/configmanager.py b/confluent_server/confluent/config/configmanager.py index 87816be7..4ce49aba 100644 --- a/confluent_server/confluent/config/configmanager.py +++ b/confluent_server/confluent/config/configmanager.py @@ -302,6 +302,8 @@ def get_global(globalname): :param globalname: The global parameter name to read """ + if _cfgstore is None: + init() try: return _cfgstore['globals'][globalname] except KeyError: @@ -318,6 +320,8 @@ def set_global(globalname, value): :param globalname: The global parameter name to store :param value: The value to set the global parameter to. """ + if _cfgstore is None: + init() with _dirtylock: if 'dirtyglobals' not in _cfgstore: _cfgstore['dirtyglobals'] = set()