summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattia Rizzolo <mattia@mapreri.org>2015-12-02 14:10:01 +0000
committerHolger Levsen <holger@layer-acht.org>2015-12-09 11:28:32 +0100
commitd5ac801b0f9ae629b9468309011785271acb717c (patch)
treeb0facce780890c6c8bf282900bf98e66052efce4
parent1b48cc5b25823b962b975423c7ae2928fcc9e583 (diff)
downloadjenkins.debian.net-d5ac801b0f9ae629b9468309011785271acb717c.tar.xz
reproducible: remote_scheduler: refactor the notification level chooser
-rwxr-xr-xbin/reproducible_remote_scheduler.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/bin/reproducible_remote_scheduler.py b/bin/reproducible_remote_scheduler.py
index 4181ac5f..756aa4b1 100755
--- a/bin/reproducible_remote_scheduler.py
+++ b/bin/reproducible_remote_scheduler.py
@@ -232,12 +232,16 @@ if amount + len(ids) > 200 and not local:
# do the actual scheduling
to_schedule = []
save_schedule = []
-notify = 1 if notify else 0
-notify = 2 if notify_on_start else 0
artifacts_value = 1 if artifacts else 0
reason = reason if reason else None
+if notify_on_start:
+ do_notify = 2
+elif notify:
+ do_notify = 1
+else:
+ do_notify = 0
for id in ids:
- to_schedule.append((id, date, artifacts_value, str(notify), requester,
+ to_schedule.append((id, date, artifacts_value, str(do_notify), requester,
reason))
save_schedule.append((id, requester, epoch))
log.debug('Packages about to be scheduled: ' + str(to_schedule))