1
0
mirror of https://github.com/ARM-software/workload-automation.git synced 2025-02-20 11:58:55 +00:00

fw/execution: fix get_resource with strict=False

If strict=False, resolver.get_resource will return None, rather
than raising NotFoundError. Do not attempt to record the md5 hash in
that case.
This commit is contained in:
Sergei Trofimov 2018-06-01 13:53:34 +01:00 committed by Marc Bonnici
parent ba717bbcd1
commit ee3c01418f

View File

@ -184,6 +184,8 @@ class ExecutionContext(object):
def get_resource(self, resource, strict=True):
result = self.resolver.get(resource, strict)
if result is None:
return result
if os.path.isfile(result):
with open(result, 'rb') as fh:
md5hash = hashlib.md5(fh.read())