summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Styk <mastyk@redhat.com>2019-08-12 15:11:31 +0200
committerMartin Styk <mastyk@redhat.com>2019-08-12 15:11:31 +0200
commit012137e2fc56e62c1b5b787a10a7f3b1e2eb9f54 (patch)
treee6a80c6a7eade4079a9217064ddcc559094d63ad
parente78812cb3d370f13422ec0cd30304bb6743c8f4e (diff)
Add owner/submitter/group to scheduler task_info
We are using task_info function in AMQ messages. Task_info is providing data for AMQ message header. Right now we would be missing crucial fields in the header. Because filtering will be mainly done on owner/submitter and some cases on group. Change-Id: Ie0eb0a9c20c1f0ad8541841cd0ffa291592c1338 Signed-off-by: Martin Styk <mastyk@redhat.com>
-rw-r--r--Server/bkr/server/model/scheduler.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/Server/bkr/server/model/scheduler.py b/Server/bkr/server/model/scheduler.py
index d39329a..7e0e85c 100644
--- a/Server/bkr/server/model/scheduler.py
+++ b/Server/bkr/server/model/scheduler.py
@@ -1258,6 +1258,9 @@ class Job(TaskBase, ActivityMixin):
result="%s" % self.result,
is_finished=self.is_finished(),
is_failed=self.is_failed(),
+ owner="{}".format(self.owner),
+ submitter="{}".format(self.submitter),
+ group="{}".format(self.group)
)
def all_recipes(self):
@@ -1894,6 +1897,9 @@ class RecipeSet(TaskBase, ActivityMixin):
result="%s" % self.result,
is_finished=self.is_finished(),
is_failed=self.is_failed(),
+ owner="{}".format(self.owner),
+ submitter="{}".format(self.job.submitter),
+ group="{}".format(self.job.group),
)
def allowed_priorities(self, user):
@@ -2767,6 +2773,9 @@ class Recipe(TaskBase, ActivityMixin):
result="%s" % self.result,
is_finished=self.is_finished(),
is_failed=self.is_failed(),
+ owner="{}".format(self.recipeset.job.owner),
+ submitter="{}".format(self.recipeset.job.submitter),
+ group="{}".format(self.recipeset.job.group),
)
def extend(self, kill_time):
@@ -3795,6 +3804,9 @@ class RecipeTask(TaskBase):
result="%s" % self.result,
is_finished=self.is_finished(),
is_failed=self.is_failed(),
+ owner="{}".format(self.recipe.recipeset.job.owner),
+ submitter="{}".format(self.recipe.recipeset.job.submitter),
+ group="{}".format(self.recipe.recipeset.job.group),
)
def no_value(self):