cur = con.cursor()
cur.execute("SAVEPOINT a")
try:
- cur.execute("INSERT INTO jenkins_build(jenkins_job_id, jenkins_build_number, build_start, build_end, status) VALUES(%s, %s, '%s', '%s', %s) RETURNING id" % (db_id, number, start, end, status))
+ cur.execute("INSERT INTO jenkins_build(jenkins_job_id, jenkins_build_number, build_start, build_end, status) VALUES(%s, %s, '%s', '%s', '%s') RETURNING id" % (db_id, number, start, end, status))
except psycopg2.DatabaseError as e:
cur.execute("ROLLBACK TO a") # have to rollback after failed command
- logger.info("INSERT INTO jenkins_build(jenkins_job_id, jenkins_build_number, build_start, build_end, status) VALUES(%s, %s, '%s', '%s', %s) RETURNING id" % (db_id, number, start, end, status))
+ logger.info("INSERT INTO jenkins_build(jenkins_job_id, jenkins_build_number, build_start, build_end, status) VALUES(%s, %s, '%s', '%s', '%s') RETURNING id" % (db_id, number, start, end, status))
return cur.fetchone()[0]
def db_add_origin(con, origin):
cur = con.cursor()
cur.execute("SAVEPOINT a")
try:
- cur.execute("INSERT INTO deb_package_instance(deb_package_id, deb_package_origin_id, jenkins_build_id, version, available) VALUES(%s, %s, %s, '%s', 'successful') RETURNING id" % (package_id, origin_id, build_id, version))
+ cur.execute("INSERT INTO deb_package_instance(deb_package_id, deb_package_origin_id, jenkins_build_id, version, available) VALUES(%s, %s, %s, '%s', true) RETURNING id" % (package_id, origin_id, build_id, version))
except psycopg2.DatabaseError as e:
# record already exist - this MUST NOT HAPPEN for jenkins builds
cur.execute("ROLLBACK TO a") # have to rollback after failed command
- logger.error("FAILED: INSERT INTO deb_package_instance(deb_package_id, deb_package_origin_id, jenkins_build_id, version, available) VALUES(%s, %s, %s, '%s', 'successful') RETURNING id" % (package_id, origin_id, build_id, version))
+ logger.error("FAILED: INSERT INTO deb_package_instance(deb_package_id, deb_package_origin_id, jenkins_build_id, version, available) VALUES(%s, %s, %s, '%s', true) RETURNING id" % (package_id, origin_id, build_id, version))
exit_error()
return cur.fetchone()[0]