From 2c17c478b6df442bcf60cc27014fe55f7a5f0ce2 Mon Sep 17 00:00:00 2001 From: Mattia Rizzolo Date: Tue, 5 May 2015 21:47:08 +0200 Subject: reproducible: remote_scheduler: add a --message switch to get convey a reason for the rescheduling to the channel --- bin/reproducible_remote_scheduler.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/bin/reproducible_remote_scheduler.py b/bin/reproducible_remote_scheduler.py index 2f51d242..fcd38561 100755 --- a/bin/reproducible_remote_scheduler.py +++ b/bin/reproducible_remote_scheduler.py @@ -20,6 +20,9 @@ parser.add_argument('-a', '--artifacts', default=False, action='store_true', help='Save artifacts (for further offline study)') parser.add_argument('-s', '--suite', required=True, help='Specify the suite to schedule for') +parser.add_argument('-m', '--message', default='', + help='A text to be sent to the channel while notifing ' + + 'the scheduling') parser.add_argument('packages', metavar='package', nargs='+', help='list of packages to reschedule') scheduling_args = parser.parse_known_args()[0] @@ -47,10 +50,12 @@ except KeyError: 'trouble with that.' + bcolors.ENDC) sys.exit(1) suite = scheduling_args.suite +reason = scheduling_args.message packages = scheduling_args.packages artifacts = scheduling_args.artifacts log.debug('Requester: ' + requester) +log.debug('Reason: ' + reason) log.debug('Artifacts: ' + str(artifacts)) log.debug('Architecture: ' + defaultarch) log.debug('Suite: ' + suite) @@ -82,7 +87,10 @@ packages_txt = ' packages ' if len(packages) > 1 else ' package ' artifacts_txt = ' - artifacts will be preserved' if artifacts else '' message = str(len(ids)) + packages_txt + 'scheduled in ' + suite + ' by ' + \ - requester + ': ' + ' '.join(packages)[0:256] + blablabla + artifacts_txt + requester +if reason: + message += ' (reason: ' + reason + ')' +message += ': ' + ' '.join(packages)[0:256] + blablabla + artifacts_txt # these packages are manually scheduled, so should have high priority, -- cgit v1.2.3-70-g09d2