post_build_project_id = buildmonitor_db.get_value_from_query_data(query, query_data)
print '[%s] post_build_project_id(%s)\n' % (__file__, post_build_project_id)
- # get curr_sr_status_id
+ # get multi_sr_status_id
query = "SELECT sr_status_id FROM sr_status_detail WHERE post_build_project_id = %s"
query_data = (post_build_project_id,)
- curr_sr_status_id = buildmonitor_db.get_value_from_query_data(query, query_data)
- #print '[%s] curr_sr_status_id(%s)\n' % (__file__, curr_sr_status_id)
+ multi_sr_status_id = buildmonitor_db.get_multi_values_from_query_data(query, query_data)
+ #print '[%s] multi_sr_status_id(%s)\n' \
+ # % (__file__, multi_sr_status_id)
- ### [POST_IMAGE] stage : update fail status for [post] image creation
- info_stage_id = POST_IMAGE
- query = "UPDATE sr_stage SET stage_start_time = %s, stage_end_time = %s, stage_status = %s " \
- "WHERE sr_status_id = %s AND info_stage_id = %s AND build_project_id = %s"
- query_data = (bm_start_datetime, bm_end_datetime, 'F',
- curr_sr_status_id, info_stage_id, post_build_project_id)
- buildmonitor_db.do_query(query, query_data)
+ ### [POST_IMAGE] stage end : [POST] image creation
+ for each_sr_status_id in multi_sr_status_id:
+ print '[%s] each_sr_status_id(%s)\n' % (__file__, each_sr_status_id)
+
+ ### [POST_IMAGE] stage : update fail status for [post] image creation
+ info_stage_id = POST_IMAGE
+ query = "UPDATE sr_stage SET stage_start_time = %s, stage_end_time = %s, stage_status = %s " \
+ "WHERE sr_status_id = %s AND info_stage_id = %s AND build_project_id = %s"
+ query_data = (bm_start_datetime, bm_end_datetime, 'F',
+ each_sr_status_id[0], info_stage_id, post_build_project_id)
+ buildmonitor_db.do_query(query, query_data)
def create_image_for_build_image(fields, bm_start_datetime,
bm_end_datetime, bm_snapshot_name, bm_img_size):