# HG changeset patch # User Goffi # Date 1580323322 -3600 # Node ID 60a9e47ef98897cb2f1b573d19d0e6787fd73498 # Parent c3e8ddf3a071ae98da84771ce92b6f8c3c050f3f core: log filenames of read config files diff -r c3e8ddf3a071 -r 60a9e47ef988 sat/memory/memory.py --- a/sat/memory/memory.py Wed Jan 29 19:28:08 2020 +0100 +++ b/sat/memory/memory.py Wed Jan 29 19:42:02 2020 +0100 @@ -237,7 +237,7 @@ self.disco = Discovery(host) # XXX: tmp update code, will be removed in the future tools_config.fixLocalDir(False) - self.config = tools_config.parseMainConf() + self.config = tools_config.parseMainConf(log_filenames=True) database_file = os.path.expanduser( os.path.join(self.getConfig("", "local_dir"), C.SAVEFILE_DATABASE) ) diff -r c3e8ddf3a071 -r 60a9e47ef988 sat/tools/config.py --- a/sat/tools/config.py Wed Jan 29 19:28:08 2020 +0100 +++ b/sat/tools/config.py Wed Jan 29 19:42:02 2020 +0100 @@ -99,13 +99,22 @@ fixConfigOption("", "local_dir", old_default, silent) -def parseMainConf(): - """look for main .ini configuration file, and parse it""" +def parseMainConf(log_filenames=False): + """Look for main .ini configuration file, and parse it + + @param log_filenames(bool): if True, log filenames of read config files + """ config = ConfigParser(defaults=C.DEFAULT_CONFIG) try: - config.read(C.CONFIG_FILES) + filenames = config.read(C.CONFIG_FILES) except Exception as e: log.error(_("Can't read main config: {msg}").format(msg=e), exc_info=True) + else: + if log_filenames: + log.info( + _("Configuration was read from: {filenames}").format( + filenames=', '.join(filenames))) + return config