mirror of
				https://github.com/ARM-software/workload-automation.git
				synced 2025-10-30 22:54:18 +00:00 
			
		
		
		
	ConfigParser: Plugin cache now handles plugin & generic config as well as global alias resolution
This commit is contained in:
		| @@ -168,36 +168,28 @@ class ConfigParser(object): | |||||||
|  |  | ||||||
|             merge_result_processors_instruments(raw) |             merge_result_processors_instruments(raw) | ||||||
|  |  | ||||||
|  |             # Get WA core configuration | ||||||
|             for cfg_point in self.wa_config.configuration.itervalues(): |             for cfg_point in self.wa_config.configuration.itervalues(): | ||||||
|                 value = get_aliased_param(cfg_point, raw) |                 value = get_aliased_param(cfg_point, raw) | ||||||
|                 if value is not None: |                 if value is not None: | ||||||
|                     self.wa_config.set(cfg_point.name, value) |                     self.wa_config.set(cfg_point.name, value) | ||||||
|  |  | ||||||
|  |             # Get run specific configuration | ||||||
|             for cfg_point in self.run_config.configuration.itervalues(): |             for cfg_point in self.run_config.configuration.itervalues(): | ||||||
|                 value = get_aliased_param(cfg_point, raw) |                 value = get_aliased_param(cfg_point, raw) | ||||||
|                 if value is not None: |                 if value is not None: | ||||||
|                     self.run_config.set(cfg_point.name, value) |                     self.run_config.set(cfg_point.name, value) | ||||||
|  |  | ||||||
|  |             # Get global job spec configuration | ||||||
|             for cfg_point in JobSpec.configuration.itervalues(): |             for cfg_point in JobSpec.configuration.itervalues(): | ||||||
|                 value = get_aliased_param(cfg_point, raw) |                 value = get_aliased_param(cfg_point, raw) | ||||||
|                 if value is not None: |                 if value is not None: | ||||||
|                     #TODO: runtime_params and boot_params |  | ||||||
|                     if cfg_point.name == "workload_parameters": |  | ||||||
|                         self.plugin_cache.add_plugin_config("workload_parameters", value, source) |  | ||||||
|                     else: |  | ||||||
|                     self.jobs_config.set_global_value(cfg_point.name, value) |                     self.jobs_config.set_global_value(cfg_point.name, value) | ||||||
|  |  | ||||||
|             device_config = raw.pop('device_config', None) |             for name, values in raw.iteritems(): | ||||||
|             if device_config: |                 # Assume that all leftover config is for a plug-in or a global | ||||||
|                 self.plugin_cache.add_device_config('device_config', device_config, source) |                 # alias it is up to PluginCache to assert this assumption | ||||||
|  |                 self.plugin_cache.add_configs(name, values, source) | ||||||
|             for name, value in raw.iteritems(): |  | ||||||
|                 if self.plugin_cache.is_global_alias(name): |  | ||||||
|                     self.plugin_cache.add_global_alias(name, value, source) |  | ||||||
|                 else: |  | ||||||
|                     # Assume that all leftover config is for a plug-in |  | ||||||
|                     # it is up to PluginCache to assert this assumption |  | ||||||
|                     self.plugin_cache.add_plugin_config(name, value, source) |  | ||||||
|  |  | ||||||
|         except ConfigError as e: |         except ConfigError as e: | ||||||
|             raise ConfigError('Error in "{}":\n{}'.format(source, str(e))) |             raise ConfigError('Error in "{}":\n{}'.format(source, str(e))) | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user