diff options
author | Daniel Shahaf <danielsh@apache.org> | 2017-06-05 11:36:51 +0000 |
---|---|---|
committer | Holger Levsen <holger@layer-acht.org> | 2017-06-05 15:25:52 +0200 |
commit | ca29f53204f5d9e87097d457f9313a7c0eaf44cd (patch) | |
tree | b132986b50f2a916adb8cbc62c8ccff615ed538f | |
parent | 3f39ea3ec7b66451c36121b2437b7ebd8845ffea (diff) | |
download | jenkins.debian.net-ca29f53204f5d9e87097d457f9313a7c0eaf44cd.tar.xz |
reproducible Debian: Break out a helper function. No functional change.
Signed-off-by: Holger Levsen <holger@layer-acht.org>
-rwxr-xr-x | bin/reproducible_remote_scheduler.py | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/bin/reproducible_remote_scheduler.py b/bin/reproducible_remote_scheduler.py index eb524441..610fff0d 100755 --- a/bin/reproducible_remote_scheduler.py +++ b/bin/reproducible_remote_scheduler.py @@ -242,18 +242,22 @@ def rest(scheduling_args, requester, local, suite, arch): ids.append(result[0][0]) pkgs.append(pkg) - blablabla = '✂…' if len(' '.join(pkgs)) > 257 else '' - packages_txt = str(len(ids)) + ' packages ' if len(pkgs) > 1 else '' - trailing = ' - artifacts will be preserved' if artifacts else '' - trailing += ' - with irc notification' if notify else '' - trailing += ' - notify on start too' if notify_on_start else '' - - message = requester + ' scheduled ' + packages_txt + \ - 'in ' + suite + '/' + arch - if reason: - message += ', reason: \'' + reason + '\'' - message += ': ' + ' '.join(pkgs)[0:256] + blablabla + trailing - + def compose_irc_message(): + "One-shot closure to limit scope of the following local variables." + blablabla = '✂…' if len(' '.join(pkgs)) > 257 else '' + packages_txt = str(len(ids)) + ' packages ' if len(pkgs) > 1 else '' + trailing = ' - artifacts will be preserved' if artifacts else '' + trailing += ' - with irc notification' if notify else '' + trailing += ' - notify on start too' if notify_on_start else '' + + message = requester + ' scheduled ' + packages_txt + \ + 'in ' + suite + '/' + arch + if reason: + message += ', reason: \'' + reason + '\'' + message += ': ' + ' '.join(pkgs)[0:256] + blablabla + trailing + return message + message = compose_irc_message() + del compose_irc_message # these packages are manually scheduled, so should have high priority, # so schedule them in the past, so they are picked earlier :) |