mirror of
https://github.com/xcat2/confluent.git
synced 2025-02-06 22:12:45 +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:
parent
fa6650a072
commit
c2115f4df9
@ -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()
|
||||
|
Loading…
x
Reference in New Issue
Block a user