1
0
mirror of https://github.com/ARM-software/workload-automation.git synced 2025-02-20 20:09:11 +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:
Sergei Trofimov 2018-06-22 16:50:49 +01:00 committed by Marc Bonnici
parent 6486378c89
commit 1b498fa42d

View File

@ -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()