mirror of
				https://github.com/ARM-software/workload-automation.git
				synced 2025-11-04 09:02:12 +00:00 
			
		
		
		
	fw/exec: context: make target_info a property
TargetManger.get_target_info() gets invoked twice: first on context creation, and then a second lime shortly afterwards to populate RunOutput. Change target_info attribute inside the context to be a property that redirects to run_output. This will allow the context to be created earlier, before a target connection is available.
This commit is contained in:
		
				
					committed by
					
						
						Marc Bonnici
					
				
			
			
				
	
			
			
			
						parent
						
							6486378c89
						
					
				
				
					commit
					1b498fa42d
				
			@@ -90,13 +90,16 @@ class ExecutionContext(object):
 | 
			
		||||
    def reboot_policy(self):
 | 
			
		||||
        return self.cm.run_config.reboot_policy
 | 
			
		||||
 | 
			
		||||
    @property
 | 
			
		||||
    def target_info(self):
 | 
			
		||||
        return self.run_output.target_info
 | 
			
		||||
 | 
			
		||||
    def __init__(self, cm, tm, output):
 | 
			
		||||
        self.logger = logging.getLogger('context')
 | 
			
		||||
        self.cm = cm
 | 
			
		||||
        self.tm = tm
 | 
			
		||||
        self.run_output = output
 | 
			
		||||
        self.run_state = output.state
 | 
			
		||||
        self.target_info = self.tm.get_target_info()
 | 
			
		||||
        self.logger.debug('Loading resource discoverers')
 | 
			
		||||
        self.resolver = ResourceResolver(cm.plugin_cache)
 | 
			
		||||
        self.resolver.load()
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user