From 5395f97a214ac9f3284d7756de72c931054dcc69 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Mon, 30 Jan 2017 16:13:49 -0500 Subject: [PATCH] Do not write out keys when redacting It's silly to store keys when redact is requested --- confluent_server/confluent/config/configmanager.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/confluent_server/confluent/config/configmanager.py b/confluent_server/confluent/config/configmanager.py index 7bf757be..2876b9d0 100644 --- a/confluent_server/confluent/config/configmanager.py +++ b/confluent_server/confluent/config/configmanager.py @@ -1476,9 +1476,10 @@ def restore_db_from_directory(location, password): def dump_db_to_directory(location, password, redact=None): - with open(os.path.join(location, 'keys.json'), 'w') as cfgfile: - cfgfile.write(_dump_keys(password)) - cfgfile.write('\n') + if not redact: + 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')