Use only one config file in config.py

Signed-off-by: Gabor Mezei <[email protected]>
This commit is contained in:
Gabor Mezei
2024-12-05 10:00:41 +01:00
parent 37bf61ee96
commit 680a7c30c2
@@ -134,13 +134,13 @@ class TFPSACryptoConfig(config_common.Config):
and modify the configuration. and modify the configuration.
""" """
def __init__(self, *configfiles): def __init__(self, filename):
"""Read the PSA crypto configuration files.""" """Read the PSA crypto configuration files."""
super().__init__() super().__init__()
self.configfiles.extend(configfiles) configfile = TFPSACryptoConfigFile(filename)
self.configfiles.append(configfile)
self.settings.update({name: config_common.Setting(configfile, active, name, value, section) self.settings.update({name: config_common.Setting(configfile, active, name, value, section)
for configfile in configfiles
for (active, name, value, section) in configfile.parse_file()}) for (active, name, value, section) in configfile.parse_file()})
def set(self, name, value=None): def set(self, name, value=None):
@@ -165,9 +165,8 @@ class TFPSACryptoConfigTool(config_common.ConfigTool):
"""Command line TF PSA Crypto config file manipulation tool.""" """Command line TF PSA Crypto config file manipulation tool."""
def __init__(self): def __init__(self):
super().__init__(TFPSACryptoConfigFile.default_path[0], single_config=False) super().__init__(TFPSACryptoConfigFile.default_path[0])
configfiles = [TFPSACryptoConfigFile(file) for file in self.args.file] self.config = TFPSACryptoConfig(self.args.file)
self.config = TFPSACryptoConfig(*configfiles)
def custom_parser_options(self): def custom_parser_options(self):
"""Adds TF PSA Crypto specific options for the parser.""" """Adds TF PSA Crypto specific options for the parser."""