2
0
mirror of https://github.com/xcat2/confluent.git synced 2025-02-07 06:22:25 +00:00

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.
This commit is contained in:
Jarrod Johnson 2017-06-29 13:08:23 -04:00
parent fa6650a072
commit c2115f4df9

View File

@ -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()