1
0
mirror of https://github.com/ARM-software/workload-automation.git synced 2025-01-31 10:11:17 +00:00

framework/output: handle missing/corrupt result files.

Do not explode if a result file for a job is missing when loading a
RunOutput. Specify job status as "UNKNOWN" and add the exception from
attempting to load the file to the events.
This commit is contained in:
Sergei Trofimov 2018-02-12 10:18:46 +00:00 committed by Marc Bonnici
parent d616d30ee1
commit c87d016025

View File

@ -64,8 +64,14 @@ class Output(object):
self.events = []
def reload(self):
try:
pod = read_pod(self.resultfile)
self.result = Result.from_pod(pod)
except Exception as e:
self.result = Result()
self.result.status = Status.UNKNOWN
self.add_event(str(e))
def write_result(self):
write_pod(self.result.to_pod(), self.resultfile)