mirror of
				https://github.com/ARM-software/workload-automation.git
				synced 2025-11-04 00:52:08 +00:00 
			
		
		
		
	config/plugin_cache: Add specific error for global and config entries
				
					
				
			Add a special error for finding `global` or `config`` entries in configuration to provide a more helpful error message.
This commit is contained in:
		@@ -22,7 +22,7 @@ from wa.framework import pluginloader
 | 
			
		||||
from wa.framework.configuration.core import get_config_point_map
 | 
			
		||||
from wa.framework.exception import ConfigError
 | 
			
		||||
from wa.framework.target.descriptor import list_target_descriptions
 | 
			
		||||
from wa.utils.types import obj_dict
 | 
			
		||||
from wa.utils.types import obj_dict, caseless_string
 | 
			
		||||
 | 
			
		||||
GENERIC_CONFIGS = ["device_config", "workload_parameters",
 | 
			
		||||
                   "boot_parameters", "runtime_parameters"]
 | 
			
		||||
@@ -79,6 +79,11 @@ class PluginCache(object):
 | 
			
		||||
            msg = "Source '{}' has not been added to the plugin cache."
 | 
			
		||||
            raise RuntimeError(msg.format(source))
 | 
			
		||||
 | 
			
		||||
        if caseless_string(plugin_name) in ['global', 'config']:
 | 
			
		||||
            msg = '"{}" entry specified inside config/global section; If this is ' \
 | 
			
		||||
            'defined in a config file, move the entry content into the top level'
 | 
			
		||||
            raise ConfigError(msg.format((plugin_name)))
 | 
			
		||||
 | 
			
		||||
        if (not self.loader.has_plugin(plugin_name) and
 | 
			
		||||
                plugin_name not in self.targets and
 | 
			
		||||
                plugin_name not in GENERIC_CONFIGS):
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user