From 4dfa2e57ab5cbc337094d07770a1a5c0a37212e6 Mon Sep 17 00:00:00 2001 From: Holger Levsen Date: Fri, 12 Oct 2012 12:02:00 +0200 Subject: [PATCH] successful is the new true --- db_add.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/db_add.py b/db_add.py index fca33be..3470352 100755 --- a/db_add.py +++ b/db_add.py @@ -66,11 +66,11 @@ def db_add_package_instance(con, package_id, origin_id, build_id, version): 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', 'true') 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', 'successful') 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', 'true') 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', 'successful') RETURNING id" % (package_id, origin_id, build_id, version)) exit_error() return cur.fetchone()[0] @@ -82,7 +82,7 @@ def add_package_instances(origin, job_name, build_number, changes_file, version, db_job_id = db_add_job(con, job_name) logger.debug("INSERT success job %s" % job_name) # maybe FIXME: we could add the build already once its started, but for package builds we dont wanna add failures to the db at all - db_build_id = db_add_build (con, db_job_id, build_number, start, end, 'true') + db_build_id = db_add_build (con, db_job_id, build_number, start, end, 'successful') logger.debug("INSERT success build number %s" % build_number) logger.debug("processing %s" %(changes_file)) cmd = ["dcmd", '--deb', changes_file] @@ -170,7 +170,7 @@ def add_liveboot_build(job_name, build_number, request_id): def finish_liveboot_build(build_id, start, end): con = db_connect() - db_add_build_result (con, build_id, start, end, 'true') + db_add_build_result (con, build_id, start, end, 'successful') con.commit() logger.info("CIDB update for liveboot OK.") return -- 2.39.5