[Qa-jenkins-scm] [jenkins.debian.net] 01/02: reproducible Debian: Break out a helper function. No functional change.

Holger Levsen holger at layer-acht.org
Mon Jun 5 13:26:02 UTC 2017


This is an automated email from the git hooks/post-receive script.

holger pushed a commit to branch master
in repository jenkins.debian.net.

commit ca29f53204f5d9e87097d457f9313a7c0eaf44cd
Author: Daniel Shahaf <danielsh at apache.org>
Date:   Mon Jun 5 11:36:51 2017 +0000

    reproducible Debian: Break out a helper function.  No functional change.
    
    Signed-off-by: Holger Levsen <holger at layer-acht.org>
---
 bin/reproducible_remote_scheduler.py | 28 ++++++++++++++++------------
 1 file changed, 16 insertions(+), 12 deletions(-)

diff --git a/bin/reproducible_remote_scheduler.py b/bin/reproducible_remote_scheduler.py
index eb52444..610fff0 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 :)

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/qa/jenkins.debian.net.git



More information about the Qa-jenkins-scm mailing list