From c41c99beeb32dcdb080ac4f30d3fcc52444c4e4c Mon Sep 17 00:00:00 2001 From: Yonghee Han Date: Mon, 24 Jun 2019 15:18:06 +0900 Subject: [PATCH] Fixed an issue with imaging status remaining in PMB Fix build_snapshot to get the last one when there are two id's. Change-Id: I132fa9f73f3822721312f851dc6dfa9465546138 --- job_buildmonitor.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/job_buildmonitor.py b/job_buildmonitor.py index e9b7130..a1cd07d 100644 --- a/job_buildmonitor.py +++ b/job_buildmonitor.py @@ -742,7 +742,7 @@ def end_create_image_for_sr_stage(bm_start_datetime, project, bm_snapshot_name): curr_build_project_id = buildmonitor_db.get_value_from_query_data(query, query_data) # get curr_build_snapshot_id - query = "SELECT id FROM build_snapshot WHERE build_project_id = %s" + query = "SELECT id FROM build_snapshot WHERE build_project_id = %s ORDER BY id DESC LIMIT 1" query_data = (curr_build_project_id,) curr_build_snapshot_id = buildmonitor_db.get_value_from_query_data(query, query_data) # get multi_build_image_status @@ -773,7 +773,7 @@ def end_create_image_for_sr_stage(bm_start_datetime, project, bm_snapshot_name): print 'post_build_project_id(%s)\n' % (post_build_project_id) # get curr_build_snapshot_id - query = "SELECT id FROM build_snapshot WHERE build_project_id = %s" + query = "SELECT id FROM build_snapshot WHERE build_project_id = %s ORDER BY id DESC LIMIT 1" query_data = (post_build_project_id,) curr_build_snapshot_id = buildmonitor_db.get_value_from_query_data(query, query_data) # get multi_build_image_status -- 2.7.4