[Qa-jenkins-scm] [jenkins.debian.net] 01/01: reproducible: move the code to call kgb and relay messagess to common.py

Holger Levsen holger at moszumanska.debian.org
Sun May 3 09:41:31 UTC 2015


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 70fb72c8253b3fa9343ddb576d52e9976f817578
Author: Mattia Rizzolo <mattia at mapreri.org>
Date:   Sun May 3 11:29:03 2015 +0200

    reproducible: move the code to call kgb and relay messagess to common.py
---
 bin/reproducible_common.py    | 7 +++++++
 bin/reproducible_notes.py     | 6 ++----
 bin/reproducible_scheduler.py | 5 +----
 3 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/bin/reproducible_common.py b/bin/reproducible_common.py
index cea16cf..6dedc05 100755
--- a/bin/reproducible_common.py
+++ b/bin/reproducible_common.py
@@ -21,6 +21,7 @@ import datetime
 import psycopg2
 import html as HTML
 from string import Template
+from subprocess import call
 from traceback import print_exception
 
 DEBUG = False
@@ -499,6 +500,12 @@ def get_trailing_bug_icon(bug, bugs, package=None):
             pass
     return html
 
+def irc_msg(msg):
+    kgb = ['kgb-client', '--conf', '/srv/jenkins/kgb/debian-reproducible.conf',
+           '--relay-msg']
+    kgb.extend(str(msg).strip().split())
+    call(kgb)
+
 # init the databases connections
 conn_db = start_db_connection()  # the local sqlite3 reproducible db
 # get_bugs() is the only user of this, let it initialize the connection itself,
diff --git a/bin/reproducible_notes.py b/bin/reproducible_notes.py
index d827663..307774a 100755
--- a/bin/reproducible_notes.py
+++ b/bin/reproducible_notes.py
@@ -13,7 +13,6 @@ import json
 import yaml
 from apt_pkg import version_compare
 from reproducible_common import *
-from subprocess import call
 
 NOTES = 'packages.yml'
 ISSUES = 'issues.yml'
@@ -50,9 +49,8 @@ def load_notes():
             print_critical_message('Warning: This query produces no results: ' + query
                                    + '\nThis means there is no tested ' +
                                    'package with the name ' + pkg)
-            kgb = ['kgb-client', '--conf', '/srv/jenkins/kgb/debian-reproducible.conf',
-                   '--relay-msg', 'There is problem with the note for '+pkg+' - please investigate' ]
-            call(kgb)
+            irc_msg('There is problem with the note for ' + pkg +
+                    ' - please investigate')
         else:
             notes[pkg] = []
             for suite in result:
diff --git a/bin/reproducible_scheduler.py b/bin/reproducible_scheduler.py
index e65e836..01bbc33 100755
--- a/bin/reproducible_scheduler.py
+++ b/bin/reproducible_scheduler.py
@@ -296,10 +296,7 @@ def scheduler():
               'for ' + str(total) + ' or ' + \
               '+'.join([str(now_queued_here[x]) for x in SUITES]) + ' packages in total.'
     log.info(message)
-    kgb = ['kgb-client', '--conf', '/srv/jenkins/kgb/debian-reproducible.conf',
-           '--relay-msg']
-    kgb.extend(message.split())
-    call(kgb)
+    irc_msg(message)
     log.info('\n\n\n')
     log.info(message)
 

-- 
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