Profile info is sent additionaly to BUILD_MONITOR
authorJunghyun Kim <jh0822.kim@samsung.com>
Wed, 25 Jan 2017 07:55:10 +0000 (16:55 +0900)
committerSoonKyu Park <sk7.park@samsung.com>
Sat, 4 Feb 2017 06:16:25 +0000 (15:16 +0900)
Change-Id: Icafcf23ab492a5eaaa4c0f1af768c075877ebd3d
Signed-off-by: Junghyun Kim <jh0822.kim@samsung.com>
job_buildmonitor.py
job_repa.py

index b45a8ee..42f3f6c 100644 (file)
@@ -1145,11 +1145,11 @@ def update_sr_submit_log_completed(git_tag):
     query_data = (git_tag)
     buildmonitor_db.do_query(query, query_data)
 
-def update_repa(sr_tag, status, status_reason):
-    print "[%s] update_repa %s, %s, %s\n", (__file__, sr_tag, status, status_reason)
+def update_repa(sr_tag, profile, status, status_reason):
+    print "[%s] update_repa %s, %s, %s, %s\n", (__file__, sr_tag, profile, status, status_reason)
 
-    query = "UPDATE sr_accept_log SET status=%s,status_reason=%s WHERE sr=%s ORDER BY id DESC LIMIT 1"
-    query_data = (status, status_reason, sr_tag)
+    query = "UPDATE sr_accept_log SET status=%s,status_reason=%s WHERE sr=%s AND profile=%s ORDER BY id DESC LIMIT 1"
+    query_data = (status, status_reason, sr_tag, profile)
     buildmonitor_db.do_query(query, query_data)
 
 def update_build_log(content):
@@ -2025,10 +2025,11 @@ def main():
     elif bm_stage == 'REPA':
         print '[%s][REPA]\n' % (__file__)
         sr_tag = content.get("sr_tag")
+        profile = content.get("profile")
         status = content.get("status")
         status_str = content.get("status_reason")
 
-        update_repa(sr_tag, status, status_str)
+        update_repa(sr_tag, profile, status, status_str)
 
     elif bm_stage == "UPDATE_BUILD_LOG":
         print "[%s][UPDATE_BUILD_LOG]\n" % (__file__)
index 2741301..0a35f60 100644 (file)
@@ -18,7 +18,7 @@
 #    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 #
 """
-This code is called by repa webpage 
+This code is called by repa webpage
 """
 
 import os
@@ -103,7 +103,7 @@ def accept_or_reject(build, prerelease_proj, git_tag, state, comment=''):
     for p in org_source_packages:
         if not is_aggregate_package(build, prerelease_proj, p):
             source_packages.append(p)
-    
+
     reqid = build.create_sr(prerelease_proj, source_packages,
                           target_prj, message=message)
 
@@ -166,6 +166,7 @@ bm_stage = "REPA"
 
 bm_data = {"bm_stage": bm_stage,
            "sr_tag": sr_tag,
+           "profile":obs_project,
            "status": status_str,
            "status_reason": error_string}
 trigger_next("BUILD-MONITOR", bm_data)