diff options
Diffstat (limited to 'bin/yp/srtool_defect.py')
-rwxr-xr-x | bin/yp/srtool_defect.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/bin/yp/srtool_defect.py b/bin/yp/srtool_defect.py index 0e189a3a..b976cf46 100755 --- a/bin/yp/srtool_defect.py +++ b/bin/yp/srtool_defect.py @@ -26,13 +26,13 @@ import os import sys import argparse -import sqlite3 import json # load the srt.sqlite schema indexes dir_path = os.path.dirname(os.path.dirname(os.path.realpath(__file__))) sys.path.insert(0, dir_path) from common.srt_schema import ORM +from common.srtool_sql import * # Setup: master_log = '' @@ -133,7 +133,7 @@ class Defect: # def new_defect_name(product_prefix): - conn = sqlite3.connect(srtDbName) + conn = SQL_CONNECT() cur = conn.cursor() sql = "SELECT * FROM orm_srtsetting WHERE name='current_defect_simulation_index'" @@ -147,7 +147,7 @@ def new_defect_name(product_prefix): sql = '''UPDATE orm_srtsetting SET value=? WHERE id = ?''' cur.execute(sql, (index, cvi[ORM.SRTSETTING_ID])) conn.commit() #commit to db - conn.close() + SQL_CLOSE_CONN(conn) defect_name = "DEFECT-%s-%05d" % (product_prefix,index) return defect_name |