mirror of
https://github.com/xcat2/confluent.git
synced 2025-01-16 20:57:53 +00:00
Clear configuration prior to sync
This commit is contained in:
parent
ecfc56efde
commit
5abaddfe63
@ -59,7 +59,11 @@ def connect_to_leader(cert=None, name=None):
|
||||
if not ndata:
|
||||
raise Exception("Error doing initial DB transfer")
|
||||
dbjson += ndata
|
||||
cfm.clear_configuration()
|
||||
cfm._restore_keys(keydata, None)
|
||||
for c in colldata:
|
||||
cfm.add_collective_member(c, colldata[c]['address'],
|
||||
colldata[c]['fingerprint'])
|
||||
cfm._cfgstore['collective'] = colldata
|
||||
for globvar in globaldata:
|
||||
cfm.set_global(globvar, globaldata[globvar])
|
||||
|
@ -374,6 +374,17 @@ cfgstreams = {}
|
||||
def register_config_listener(name, listener):
|
||||
cfgstreams[listener] = name
|
||||
|
||||
def clear_configuration():
|
||||
global _cfgstore
|
||||
_cfgstore = {}
|
||||
todelete = _config_areas + ('globals', 'collective')
|
||||
for cfg in todelete:
|
||||
try:
|
||||
os.remove(os.path.join(ConfigManager._cfgdir, cfg))
|
||||
except OSError as oe:
|
||||
pass
|
||||
|
||||
|
||||
def add_collective_member(name, address, fingerprint):
|
||||
try:
|
||||
name = name.encode('utf-8')
|
||||
|
Loading…
x
Reference in New Issue
Block a user