From c87d01602571cdc63949d15bd9252ca4825f3ddf Mon Sep 17 00:00:00 2001 From: Sergei Trofimov Date: Mon, 12 Feb 2018 10:18:46 +0000 Subject: [PATCH] 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. --- wa/framework/output.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/wa/framework/output.py b/wa/framework/output.py index fecff36b..4f5c5648 100644 --- a/wa/framework/output.py +++ b/wa/framework/output.py @@ -64,8 +64,14 @@ class Output(object): self.events = [] def reload(self): - pod = read_pod(self.resultfile) - self.result = Result.from_pod(pod) + 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)