"VALUES ( %(id)s, %(sr_status_id)s, %(ref_id)s, %(sr_name)s, %(snapshot_num)s, %(profile)s, %(plan_name)s, %(total)s, %(pass)s, %(fail)s, "
"%(block)s, %(na)s, %(pcnt)s, %(time_start)s, %(time_end)s, %(build_id)s, %(device_id)s, %(device_model)s, %(device_name)s, "
"%(device_host)s, %(manufacturer)s, %(tct_profile)s, %(tct_version)s, %(url)s )" )
-
+
try:
value['sr_status_id'] = RESULT['sr_id']
print "[Error] wrong data (", key, ") -", value
+ trbs_test_stage_id = 101
+ cur_time = datetime.datetime.now()
+ insert_sr_stage_sql = "INSERT INTO sr_stage (sr_status_id, info_stage_id, stage_start_time, stage_end_time, stage_status, build_project_id) VALUES ( %s, %s, %s, %s, %s, %s)";
+ insert_sr_stage_data = (RESULT['sr_id'], trbs_test_stage_id, cur_time, cur_time, 'S', RESULT['build_project_id'] )
+ try:
+ query.execute(insert_sr_stage_sql, insert_sr_stage_data)
+ dbcon.commit();
+ print "[Insert: sr_stage]" + str(insert_sr_stage_sql) + "\n" + str(insert_sr_stage_data)
+ except MySQLdb.IntegrityError:
+ print "[Error] " + str(insert_sr_stage_sql) + "\n" + str(insert_sr_stage_data)
+ # update sr_stage status.
query.close()
dbcon.close()