diff --git a/cps/config_sql.py b/cps/config_sql.py index a17622eb..b1e487f9 100644 --- a/cps/config_sql.py +++ b/cps/config_sql.py @@ -272,6 +272,14 @@ class _ConfigSQL(object): setattr(self, field, new_value) return True + def toDict(self): + storage = {} + for k, v in self.__dict__.items(): + if k[0] != '_' or k.endswith("password"): + storage[k] = v + return storage + + def load(self): '''Load all configuration values from the underlying storage.''' s = self._read_from_storage() # type: _Settings diff --git a/cps/debug_info.py b/cps/debug_info.py index 75ef3bb8..aae97001 100644 --- a/cps/debug_info.py +++ b/cps/debug_info.py @@ -44,8 +44,12 @@ def assemble_logfiles(file_name): def send_debug(): file_list = glob.glob(logger.get_logfile(config.config_logfile) + '*') file_list.extend(glob.glob(logger.get_accesslogfile(config.config_access_logfile) + '*')) + for element in [logger.LOG_TO_STDOUT, logger.LOG_TO_STDERR]: + if element in file_list: + file_list.remove(element) memory_zip = io.BytesIO() with zipfile.ZipFile(memory_zip, 'w', compression=zipfile.ZIP_DEFLATED) as zf: + zf.writestr('settings.txt', json.dumps(config.toDict())) zf.writestr('libs.txt', json.dumps(collect_stats())) for fp in file_list: zf.write(fp, os.path.basename(fp))