# return the number of failed packages except *_aggregate packages.
return failed_packages_cnt
-def start_pre_create_snapshot_for_sr_stage(project, bm_git_tag, bm_start_datetime):
+def start_pre_create_snapshot_for_sr_stage(project, bm_git_tag, bm_start_datetime, bBuildFail):
print '[%s] enter start_pre_create_snapshot_for_sr_stage\n' % (__file__)
# get curr_sr_status_id
query_data = (curr_info_project_id,)
curr_build_project_id = buildmonitor_db.get_value_from_query_data(query, query_data)
- # [16_1206] if change the build fail check method, disable
- '''
- # << 1st >>
- # get multi_build_status from build_target
- query = "SELECT status FROM build_target WHERE build_project_id = %s " \
- "AND last_flag = %s"
- query_data = (curr_build_project_id, 'Y')
- multi_build_status = buildmonitor_db.get_multi_values_from_query_data(query, query_data)
- print '[%s] multi_build_status(%s)\n' % (__file__, multi_build_status)
-
- # default 'S'
- info_stage_status = 'S'
- for each_build_status in multi_build_status:
- #print '[%s] each_build_status(%s)\n' % (__file__, each_build_status)
- if each_build_status[0] == 'F':
- info_stage_status = 'F'
- #print '[%s] failed!! info_stage_status(%s)\n' % (__file__, info_stage_status)
- '''
-
- # << 2nd >>
- # get curr_build_project_status
- query = "SELECT status FROM build_project WHERE info_project_id = %s"
- query_data = (curr_info_project_id,)
- curr_build_project_status = buildmonitor_db.get_value_from_query_data(query, query_data)
- print '[%s] curr_build_project_status(%s)\n' % (__file__, curr_build_project_status)
-
- # [16_1208] change the build fail check method from build_target status to build_project status
- if curr_build_project_status == 'F':
+ print '[%s] bBuildFail(%s)\n' % (__file__, bBuildFail)
+ if bBuildFail == True:
info_stage_status = 'F'
-
- # if only *_aggregate packages are failed, make it 'S'
- if num_failed_packages_except_aggregate(curr_build_project_id) == 0:
- print
- print ('[%s] The build status is determined as failed, ' % (__file__)),
- print 'but only _aggregate packages are failed.'
- print '[%s] So, final build status is corrected to S!' % (__file__)
- info_stage_status = 'S'
-
else:
info_stage_status = 'S'
query_data = ('F', curr_sr_status_id, info_stage_id, curr_build_project_id)
buildmonitor_db.do_query(query, query_data)
-def TRBS_start_pre_create_snapshot_for_sr_stage(project, bm_git_tag, bm_start_datetime):
+def TRBS_start_pre_create_snapshot_for_sr_stage(project, bm_git_tag, bm_start_datetime, bBuildFail):
print '[%s] enter TRBS_start_pre_create_snapshot_for_sr_stage\n' % (__file__)
# get curr_sr_status_id
query_data = (curr_info_project_id,)
curr_build_project_id = buildmonitor_db.get_value_from_query_data(query, query_data)
- # [16_1206] if change the build fail check method, disable
'''
# << 1st >>
# get multi_build_status from build_target
if each_build_status[0] == 'F':
info_stage_status = 'F'
#print '[%s] failed!! info_stage_status(%s)\n' % (__file__, info_stage_status)
- '''
# << 2nd >>
# get curr_build_project_status
info_stage_status = 'F'
else:
info_stage_status = 'S'
+ '''
+
+ # << 3rd >>
+ print '[%s] bBuildFail(%s)\n' % (__file__, bBuildFail)
+ if bBuildFail == True:
+ info_stage_status = 'F'
+ else:
+ info_stage_status = 'S'
### [TRBS_BUILD] stage end : [trbs] package build
info_stage_id = TRBS_BUILD
# func call
if bm_stage == 'Pre_Snap_Start':
print '[%s][Pre_Snap_Start]\n' % (__file__)
- start_pre_create_snapshot_for_sr_stage(project, bm_git_tag, bm_start_datetime)
+ start_pre_create_snapshot_for_sr_stage(project, bm_git_tag, bm_start_datetime, bBuildFail)
# [17_0110] TRBS
if bm_stage == '[TRBS]_Pre_Snap_Start':
print '[%s][[TRBS]_Pre_Snap_Start]\n' % (__file__)
- TRBS_start_pre_create_snapshot_for_sr_stage(project, bm_git_tag, bm_start_datetime)
+ TRBS_start_pre_create_snapshot_for_sr_stage(project, bm_git_tag, bm_start_datetime, bBuildFail)
# if bBuildFail is True then skip Creating images
if bBuildFail != True: