1
0
mirror of https://github.com/ARM-software/workload-automation.git synced 2025-01-18 12:06:08 +00:00

fw/config: preserve included config files

Save included config files, along with the explicitly-specified config
that included them, under run output's __meta/raw_config/.
This commit is contained in:
Sergei Trofimov 2018-07-19 14:43:46 +01:00 committed by Marc Bonnici
parent 7d833ec112
commit e4a856ad03
2 changed files with 5 additions and 2 deletions

View File

@ -97,8 +97,10 @@ class RunCommand(Command):
parser = AgendaParser()
if os.path.isfile(args.agenda):
parser.load_from_path(config, args.agenda)
includes = parser.load_from_path(config, args.agenda)
shutil.copy(args.agenda, output.raw_config_dir)
for inc in includes:
shutil.copy(inc, output.raw_config_dir)
else:
try:
pluginloader.get_plugin_class(args.agenda, kind='workload')

View File

@ -90,8 +90,9 @@ class ConfigManager(object):
self.agenda = None
def load_config_file(self, filepath):
self._config_parser.load_from_path(self, filepath)
includes = self._config_parser.load_from_path(self, filepath)
self.loaded_config_sources.append(filepath)
self.loaded_config_sources.extend(includes)
def load_config(self, values, source):
self._config_parser.load(self, values, source)