return cur.fetchone()[0]
def harmonize_timeformat(time):
- logger.debug('1 time = %s' % time)
if time != 'NULL':
try:
if time.isdigit():
- logger.debug('2 time = %s' % time)
time = "to_timestamp('%s')" % time
- logger.debug('3 time = %s' % time)
except:
time = "'%s'" % time
- logger.debug('4 time = %s' % time)
return time
def db_add_build(con, db_id, number, start, end, status):
cur = con.cursor()
cur.execute("SAVEPOINT a")
- logger.debug('start = %s' % start)
start = harmonize_timeformat(start)
- logger.debug('harmonized_start = %s' % start)
end = harmonize_timeformat(end)
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))
def db_update_build(con, db_id, end, status):
cur = con.cursor()
cur.execute("SAVEPOINT a")
- logger.debug('end = %s' % end)
end = harmonize_timeformat(end)
logger.debug('harmonized_end = %s' % end)
try:
cmd = ['figlet-figlet', '-t', 'CIDB problem:']
subprocess.check_call(cmd)
logger.error("package instance not added to DB")
- #exit_error()
+ exit_error()
if len(package_instances) > 0:
try:
add_liveboot_request(package_instances)