[Qa-jenkins-scm] [jenkins.debian.net] 05/05: reproducible: common.py: allow passing parameters to query_db()

Mattia Rizzolo mattia at debian.org
Mon Dec 11 09:54:06 UTC 2017


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

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

commit e0e1ac745a6741233edf718f741bd76889255338
Author: Mattia Rizzolo <mattia at debian.org>
Date:   Tue Nov 28 16:47:52 2017 +0100

    reproducible: common.py: allow passing parameters to query_db()
    
    let's stop doing manual string interpolation...
    
    Signed-off-by: Mattia Rizzolo <mattia at debian.org>
---
 bin/reproducible_common.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/bin/reproducible_common.py b/bin/reproducible_common.py
index 00f91e9..60abc75 100755
--- a/bin/reproducible_common.py
+++ b/bin/reproducible_common.py
@@ -402,7 +402,7 @@ def db_table(table_name):
         raise
 
 
-def query_db(query):
+def query_db(query, *args, **kwargs):
     """Excutes a raw SQL query. Return depends on query type.
 
     Returns:
@@ -414,7 +414,7 @@ def query_db(query):
             None
     """
     try:
-        result = conn_db.execute(query)
+        result = conn_db.execute(query, *args, **kwargs)
     except OperationalError as ex:
         print_critical_message('Error executing this query:\n' + query)
         raise

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