diff options
author | Mattia Rizzolo <mattia@mapreri.org> | 2015-05-05 21:47:08 +0200 |
---|---|---|
committer | Holger Levsen <holger@layer-acht.org> | 2015-05-08 12:03:13 +0200 |
commit | 2c17c478b6df442bcf60cc27014fe55f7a5f0ce2 (patch) | |
tree | f14e8d0097f78ad8e15728958de83a86825a018b | |
parent | 172fe9d09b2c513477912bf0e705d0233cf060c6 (diff) | |
download | jenkins.debian.net-2c17c478b6df442bcf60cc27014fe55f7a5f0ce2.tar.xz |
reproducible: remote_scheduler: add a --message switch to get convey a reason for the rescheduling to the channel
-rwxr-xr-x | bin/reproducible_remote_scheduler.py | 10 |
1 files changed, 9 insertions, 1 deletions
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, |