From 54b196c4f43bba4e9e2b6d370e2f301a5a7c1831 Mon Sep 17 00:00:00 2001 From: Mattia Rizzolo Date: Sun, 14 Jun 2015 20:07:54 +0200 Subject: reproducible: remote_scheduler: add logic to avoid people scheduling >50 packages with irc notification --- bin/reproducible_remote_scheduler.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'bin') 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).') -- cgit v1.2.3-54-g00ecf