From cc611176fb5e2a4d04f74f81d2e7674d6355978f Mon Sep 17 00:00:00 2001 From: SungHun Hwang Date: Mon, 5 Jun 2017 17:29:22 +0900 Subject: [PATCH] [BuildMonitor] Add the TRBS mode check routine Add the TRBS mode check routine Change-Id: If44f54a2d809637c56311bbccddec7ffe1d3cdd5 Signed-off-by: SungHun Hwang --- job_buildmonitor.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/job_buildmonitor.py b/job_buildmonitor.py index b4f3197..b9184b1 100644 --- a/job_buildmonitor.py +++ b/job_buildmonitor.py @@ -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(' ', '+') -- 2.7.4