From 8cea5a4fed282449d0de98d282c75548d07fea9d Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Wed, 13 Jun 2018 09:15:27 -0400 Subject: [PATCH] Fix redacted db dump The db dump function did not trigger the init() function. Rearrange the collective section to occur after a section that does ensure the configmanager is initted. --- confluent_server/confluent/config/configmanager.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/confluent_server/confluent/config/configmanager.py b/confluent_server/confluent/config/configmanager.py index d0c895b6..897a3206 100644 --- a/confluent_server/confluent/config/configmanager.py +++ b/confluent_server/confluent/config/configmanager.py @@ -1985,13 +1985,13 @@ def dump_db_to_directory(location, password, redact=None, skipkeys=False): with open(os.path.join(location, 'keys.json'), 'w') as cfgfile: cfgfile.write(_dump_keys(password)) cfgfile.write('\n') + with open(os.path.join(location, 'main.json'), 'w') as cfgfile: + cfgfile.write(ConfigManager(tenant=None)._dump_to_json(redact=redact)) + cfgfile.write('\n') if 'collective' in _cfgstore: with open(os.path.join(location, 'collective.json'), 'w') as cfgfile: cfgfile.write(json.dumps(_cfgstore['collective'])) cfgfile.write('\n') - with open(os.path.join(location, 'main.json'), 'w') as cfgfile: - cfgfile.write(ConfigManager(tenant=None)._dump_to_json(redact=redact)) - cfgfile.write('\n') bkupglobals = get_globals() if bkupglobals: json.dump(bkupglobals, open(os.path.join(location, 'globals.json'),