From 1527fe1159b1352905f3f7a39800f646c162c99f Mon Sep 17 00:00:00 2001 From: linchaogithub Date: Fri, 21 Mar 2014 17:36:27 +0800 Subject: [PATCH] [jenkins-watchdog]add the time of single job --- tools/jenkins-scripts/watchdog.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tools/jenkins-scripts/watchdog.py b/tools/jenkins-scripts/watchdog.py index b23695218e..0efb0d04ca 100644 --- a/tools/jenkins-scripts/watchdog.py +++ b/tools/jenkins-scripts/watchdog.py @@ -7,7 +7,6 @@ import os #check & kill dead buid def build_time(_job,_threshold): #get jenkins-job-watchdog-threshold - threshold = int(os.environ['jenkins-job-watchdog-threshold']) #Get last build running build = _job.get_last_build() running = build.is_running() @@ -41,8 +40,8 @@ def main(): J = Jenkins('http://115.28.134.83:8000',username,password) #get all jenkins jobs for key,job in J.iteritems(): - if(os.environ.has_key(key)): - threshold = int(os.environ[key]) + if(os.environ.has_key(key+'-threshold')): + threshold = int(os.environ[key+'-threshold']) build_time(job,threshold) else: threshold = int(os.environ['jenkins-job-watchdog-threshold'])