summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Shahaf <danielsh@apache.org>2017-06-05 11:36:51 +0000
committerHolger Levsen <holger@layer-acht.org>2017-06-05 15:25:52 +0200
commitca29f53204f5d9e87097d457f9313a7c0eaf44cd (patch)
treeb132986b50f2a916adb8cbc62c8ccff615ed538f
parent3f39ea3ec7b66451c36121b2437b7ebd8845ffea (diff)
downloadjenkins.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-xbin/reproducible_remote_scheduler.py28
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 :)