1
0
mirror of https://github.com/ARM-software/workload-automation.git synced 2025-09-02 19:32:34 +01:00

fw/exec: Add add_classifier() method

Add add_classifier() method to context. Allow plugins to add classifiers
to the current job, or the run as a whole. This will ensure that the new
classifiers are propagated to all relevant current and future artifacts
and metrics.
This commit is contained in:
Sergei Trofimov
2020-01-17 15:07:21 +00:00
committed by Marc Bonnici
parent 796f62d924
commit 659e60414f
4 changed files with 45 additions and 3 deletions

View File

@@ -181,6 +181,11 @@ class Job(object):
if force or self.status < status:
self.status = status
def add_classifier(self, name, value, overwrite=False):
if name in self.classifiers and not overwrite:
raise ValueError('Cannot overwrite "{}" classifier.'.format(name))
self.classifiers[name] = value
def __str__(self):
return '{} ({}) [{}]'.format(self.id, self.label, self.iteration)