From 3520e7da0bd5d4368185b5f720b5faefd0638025 Mon Sep 17 00:00:00 2001 From: lm Date: Fri, 30 May 2014 12:51:54 +0800 Subject: [PATCH] [Jenkins][ci skip] Fix proxy address to jenkins config --- tools/jenkins-scripts/job-comment-trigger.py | 4 +++- tools/jenkins-scripts/job-trigger.py | 4 +++- tools/jenkins-scripts/post-build.py | 4 +++- tools/jenkins-scripts/pull-request-builder.py | 4 +++- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/tools/jenkins-scripts/job-comment-trigger.py b/tools/jenkins-scripts/job-comment-trigger.py index ddf1a14331..8ba9d710af 100644 --- a/tools/jenkins-scripts/job-comment-trigger.py +++ b/tools/jenkins-scripts/job-comment-trigger.py @@ -8,7 +8,9 @@ import sys import traceback import urllib2 -http_proxy = os.environ['HTTP_PROXY'] +http_proxy = '' +if(os.environ.has_key('HTTP_PROXY')): + http_proxy = os.environ['HTTP_PROXY'] proxyDict = {'http':http_proxy,'https':http_proxy} def main(): diff --git a/tools/jenkins-scripts/job-trigger.py b/tools/jenkins-scripts/job-trigger.py index 79973d6e93..54e566e94c 100755 --- a/tools/jenkins-scripts/job-trigger.py +++ b/tools/jenkins-scripts/job-trigger.py @@ -8,7 +8,9 @@ import sys import traceback from jenkinsapi.jenkins import Jenkins -http_proxy = os.environ['HTTP_PROXY'] +http_proxy = '' +if(os.environ.has_key('HTTP_PROXY')): + http_proxy = os.environ['HTTP_PROXY'] proxyDict = {'http':http_proxy,'https':http_proxy} def check_queue_build(action, pr_num, statuses_url): diff --git a/tools/jenkins-scripts/post-build.py b/tools/jenkins-scripts/post-build.py index 54d273f199..184b56b900 100644 --- a/tools/jenkins-scripts/post-build.py +++ b/tools/jenkins-scripts/post-build.py @@ -5,7 +5,9 @@ import jenkinsapi from jenkinsapi.jenkins import Jenkins from jenkinsapi.constants import STATUS_SUCCESS -payload_str = os.environ['payload'] +http_proxy = '' +if(os.environ.has_key('HTTP_PROXY')): + http_proxy = os.environ['HTTP_PROXY'] payload_str = payload_str.decode('utf-8','ignore') #parse to json obj payload = json.loads(payload_str) diff --git a/tools/jenkins-scripts/pull-request-builder.py b/tools/jenkins-scripts/pull-request-builder.py index 8be309914b..d506bb0df5 100755 --- a/tools/jenkins-scripts/pull-request-builder.py +++ b/tools/jenkins-scripts/pull-request-builder.py @@ -61,7 +61,9 @@ def check_current_3rd_libs(branch): current_file = current_files[i] copy(current_file, backup_file) -http_proxy = os.environ['HTTP_PROXY'] +http_proxy = '' +if(os.environ.has_key('HTTP_PROXY')): + http_proxy = os.environ['HTTP_PROXY'] proxyDict = {'http':http_proxy,'https':http_proxy} def main(): #get payload from os env