[BuildMonitor] Add the TRBS mode check routine 50/132450/1
authorSungHun Hwang <sh0924.hwang@samsung.com>
Mon, 5 Jun 2017 08:29:22 +0000 (17:29 +0900)
committerSungHun Hwang <sh0924.hwang@samsung.com>
Mon, 5 Jun 2017 08:29:22 +0000 (17:29 +0900)
Add the TRBS mode check routine

Change-Id: If44f54a2d809637c56311bbccddec7ffe1d3cdd5
Signed-off-by: SungHun Hwang <sh0924.hwang@samsung.com>
job_buildmonitor.py

index b4f3197..b9184b1 100644 (file)
@@ -1883,8 +1883,14 @@ def main():
     """
     bm_connect_db()
 
-    # TRBS Sender mode
-    trbs_buildmonitor_enabled = int(os.getenv("TRBS_BUILDMONITOR_ENABLED", "0"))
+    # check TRBS Sender mode
+    if not os.getenv("TRBS_BUILDMONITOR_ENABLED"):
+        trbs_buildmonitor_enabled = 0
+        print 'TRBS_BUILDMONITOR_ENABLED does not exist!!, set the public mode forcely(%s)\n' \
+              % trbs_buildmonitor_enabled
+    else:
+        trbs_buildmonitor_enabled = int(os.getenv("TRBS_BUILDMONITOR_ENABLED"))
+        print 'TRBS_BUILDMONITOR_ENABLED is %s\n' % trbs_buildmonitor_enabled
 
     # prevent base64 decoding error when triggered by the remote host
     trigger_info_data = os.getenv('TRIGGER_INFO').replace(' ', '+')