Verbose mode in sql query multi select 35/163435/1
authorhyokeun <hyokeun.jeon@samsung.com>
Mon, 11 Dec 2017 07:05:10 +0000 (16:05 +0900)
committerhyokeun <hyokeun.jeon@samsung.com>
Mon, 11 Dec 2017 07:05:10 +0000 (16:05 +0900)
Change-Id: Ieba78b2b3b95110ca2c62ce4364f13b09eea7d8a

common/buildmonitor_db.py

index 3c4df8c..b03022c 100644 (file)
@@ -19,14 +19,16 @@ import MySQLdb
 
 INVALID_ID = 0
 
-def get_multi_values_from_query_data(query, data):
+def get_multi_values_from_query_data(query, data, verbose=True):
     try:
-        print 'query(%s), data(%s)' % (query, data)
+        if verbose:
+            print 'query(%s), data(%s)' % (query, data)
 
         cursor = conn.cursor()
         cursor.execute(query, data)
         ret_rows = cursor.fetchall()
-        print 'ret_rows(%s)' % (ret_rows,)
+        if verbose:
+            print 'ret_rows(%s)' % (ret_rows,)
         conn.commit()
         cursor.close()