diff --git a/tools/jenkins-scripts/post-build.py b/tools/jenkins-scripts/post-build.py index 184b56b900..78f7ddf735 100644 --- a/tools/jenkins-scripts/post-build.py +++ b/tools/jenkins-scripts/post-build.py @@ -5,9 +5,7 @@ import jenkinsapi from jenkinsapi.jenkins import Jenkins from jenkinsapi.constants import STATUS_SUCCESS -http_proxy = '' -if(os.environ.has_key('HTTP_PROXY')): - http_proxy = os.environ['HTTP_PROXY'] +payload_str = os.environ['payload'] payload_str = payload_str.decode('utf-8','ignore') #parse to json obj payload = json.loads(payload_str) @@ -31,6 +29,8 @@ if(result == STATUS_SUCCESS): else: data['state'] = "failure" -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} requests.post(statuses_url, data=json.dumps(data), headers=Headers, proxies = proxyDict)