]> Frank Brehm's Git Trees - profitbricks/jenkins-build-scripts.git/commitdiff
timestamp it
authorHolger Levsen <holger@layer-acht.org>
Fri, 12 Oct 2012 13:28:12 +0000 (15:28 +0200)
committerHolger Levsen <holger@layer-acht.org>
Fri, 12 Oct 2012 13:28:12 +0000 (15:28 +0200)
db_add.py

index e498b7c5b79335cefdd489fa4971f214ebd25ee3..934668b5206650162cf89cde411decb76cd0061b 100755 (executable)
--- a/db_add.py
+++ b/db_add.py
@@ -48,11 +48,11 @@ def db_update_build(con, db_id, end, status):
     cur = con.cursor()
     cur.execute("SAVEPOINT a")
     try:
-        cur.execute("UPDATE jenkins_build SET build_end = '%s', status = '%s' WHERE id = %s RETURNING id" % (end, status, db_id))
+        cur.execute("UPDATE jenkins_build SET build_end = to_timestamp('%s'), status = '%s' WHERE id = %s RETURNING id" % (end, status, db_id))
         con.commit()
     except psycopg2.DatabaseError as e:
         cur.execute("ROLLBACK TO a")  # have to rollback after failed command
-        logger.debug("UPDATE jenkins_build SET build_end = '%s', status = '%s' WHERE id = %s RETURNING id" % (end, status, db_id))
+        logger.debug("UPDATE jenkins_build SET build_end = to_timestamp('%s'), status = '%s' WHERE id = %s RETURNING id" % (end, status, db_id))
     return cur.fetchone()[0]
 
 def db_add_origin(con, origin):