#===============================================================================
# [job_submit.py]
+def truncate_msg(msg):
+ MAX_MSG_LEN = int(os.getenv("BUILDMONITOR_MAX_MSG_LEN"))
+ ret_msg = (msg[:MAX_MSG_LEN-2] + '..') if len(msg) > MAX_MSG_LEN else msg
+ return ret_msg
+
def transform_date(date):
# Currently, we just remove timezone part (e.g., '+0900')
# Should we consider timezone in the future??
print '[%s] enter sr_accept_reject_for_sr_status_detail\n' % (__file__)
obs_req_no = event_fields['id']
- obs_req_comment = event_fields['description']
+ obs_req_comment = truncate_msg(event_fields['description'])
obs_req_date = bm_end_datetime
obs_req_status = event_fields['state']
obs_req_status = obs_req_status.upper()
#=======================================================
# Submit
- #elif bm_stage == 'Submit':
elif bm_stage == 'Submit' or bm_stage == '[TRBS]_Submit':
print '[%s][Submit]\n' % (__file__)
# get vars
commit_date = transform_date(content.get("commit_date"))
- commit_msg = content.get("commit_msg")
+ commit_msg = truncate_msg(content.get("commit_msg"))
submit_date = transform_date(content.get("submit_date"))
- submit_msg = content.get("submit_msg")
+ submit_msg = truncate_msg(content.get("submit_msg"))
submitter = content.get("submitter")
git_tag = content.get("git_tag")
gerrit_project = content.get("gerrit_project")