summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorMattia Rizzolo <mattia@mapreri.org>2015-06-14 20:07:54 +0200
committerHolger Levsen <holger@layer-acht.org>2015-06-14 22:36:07 +0200
commit54b196c4f43bba4e9e2b6d370e2f301a5a7c1831 (patch)
treef17779af1db1c74e4e260f309d48c88a9f2efa9e /bin
parent98cbb7d97f540dfe073ed235e96123903c31369f (diff)
downloadjenkins.debian.net-54b196c4f43bba4e9e2b6d370e2f301a5a7c1831.tar.xz
reproducible: remote_scheduler: add logic to avoid people scheduling >50 packages with irc notification
Diffstat (limited to 'bin')
-rwxr-xr-xbin/reproducible_remote_scheduler.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/bin/reproducible_remote_scheduler.py b/bin/reproducible_remote_scheduler.py
index bee9a741..6a6724fd 100755
--- a/bin/reproducible_remote_scheduler.py
+++ b/bin/reproducible_remote_scheduler.py
@@ -38,9 +38,10 @@ from reproducible_html_indexes import generate_schedule
class bcolors:
BOLD = '\033[1m'
UNDERLINE = '\033[4m'
+ RED = '\033[91m'
GOOD = '\033[92m'
WARN = '\033[93m' + UNDERLINE
- FAIL = '\033[91m' + BOLD + UNDERLINE
+ FAIL = RED + BOLD + UNDERLINE
ENDC = '\033[0m'
@@ -78,6 +79,14 @@ if suite not in SUITES:
log.critical('Please chose between ' + ', '.join(SUITES))
sys.exit(1)
+if len(packages) > 50 and notify:
+ log.critical(bcolors.RED + bcolors.BOLD)
+ call(['figlet', 'No.'])
+ log.critical(bcolors.FAIL + 'Do not reschedule more than 50 packages ' +
+ 'with notification.\nIf you really need to spam the IRC ' +
+ 'channel this much use a loop to achive that.' + bcolors.ENDC)
+ sys.exit(1)
+
if scheduling_args.artifacts:
log.info('The artifacts of the build(s) will be saved to the location '
'mentioned at the end of the build log(s).')