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

framework/output: output fixes

- Get events from the result
- Correctly handle pending jobs
This commit is contained in:
Sergei Trofimov 2018-03-01 09:53:49 +00:00 committed by Marc Bonnici
parent 79aaef9986
commit 879dfc7700

View File

@ -72,15 +72,24 @@ class Output(object):
raise RuntimeError(msg)
self.result.classifiers = value
@property
def events(self):
if self.result is None:
return []
return self.result.events
def __init__(self, path):
self.basepath = path
self.result = None
self.events = []
def reload(self):
try:
pod = read_pod(self.resultfile)
self.result = Result.from_pod(pod)
if os.path.isdir(self.basepath):
pod = read_pod(self.resultfile)
self.result = Result.from_pod(pod)
else:
self.result = Result()
self.result.status = Status.PENDING
except Exception as e:
self.result = Result()
self.result.status = Status.UNKNOWN