1
0
mirror of https://github.com/ARM-software/workload-automation.git synced 2025-09-04 20:32:36 +01:00

fw/target: detect module variations in TargetInfo

- Add modules entry to TargetInfo
- When retrieving TargetInfo from cache, make sure info modules match
  those for the current target, otherwise mark info as stale and
  re-generate.
This commit is contained in:
Sergei Trofimov
2019-09-12 09:13:20 +01:00
committed by Marc Bonnici
parent 75878e2f27
commit 2f231b5ce5
7 changed files with 32 additions and 5 deletions

View File

@@ -92,9 +92,18 @@ class TargetManager(object):
@memoized
def get_target_info(self):
info = get_target_info_from_cache(self.target.system_id)
if info is None:
info = get_target_info(self.target)
cache_target_info(info)
else:
# If module configuration has changed form when the target info
# was previously cached, it is possible additional info will be
# available, so should re-generate the cache.
if set(info.modules) != set(self.target.modules):
info = get_target_info(self.target)
cache_target_info(info, overwrite=True)
return info
def reboot(self, context, hard=False):