From d5ac801b0f9ae629b9468309011785271acb717c Mon Sep 17 00:00:00 2001 From: Mattia Rizzolo Date: Wed, 2 Dec 2015 14:10:01 +0000 Subject: reproducible: remote_scheduler: refactor the notification level chooser --- bin/reproducible_remote_scheduler.py | 10 +++++++--- 1 file 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)) -- cgit v1.2.3-70-g09d2