aboutsummaryrefslogtreecommitdiffstats
path: root/src/jenkins/adapter.py
diff options
context:
space:
mode:
authorJack Morgan <jack.morgan@intel.com>2017-12-07 19:39:00 +0000
committerGerrit Code Review <gerrit@opnfv.org>2017-12-07 19:39:00 +0000
commit1b9e76a483822a830a1b67acb817467ee907b93c (patch)
treef8c1144087a6a58c5a78b8e20076e3ca49d26a6c /src/jenkins/adapter.py
parente3dc55b54713e4a9e015cffcbc35ef811ff6606b (diff)
parent50ca17b63ab7f79ec2b8326d3d1e5f3448091214 (diff)
Merge "Abstract Hard-Coded URLs to Config File"
Diffstat (limited to 'src/jenkins/adapter.py')
-rw-r--r--src/jenkins/adapter.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/jenkins/adapter.py b/src/jenkins/adapter.py
index edf502f..b48b868 100644
--- a/src/jenkins/adapter.py
+++ b/src/jenkins/adapter.py
@@ -10,6 +10,7 @@
import logging
import re
+from django.conf import settings
import requests
from django.core.cache import cache
@@ -33,13 +34,15 @@ def get_json(url):
def get_all_slaves():
- url = "https://build.opnfv.org/ci/computer/api/json?tree=computer[displayName,offline,idle]"
+ url = settings.ALL_SLAVES_URL
json = get_json(url)
if json is not None:
return json['computer'] # return list of dictionaries
return []
+
+
def get_slave(slavename):
slaves = get_all_slaves()
for slave in slaves:
@@ -49,7 +52,7 @@ def get_slave(slavename):
def get_ci_slaves():
- url = "https://build.opnfv.org/ci/label/ci-pod/api/json?tree=nodes[nodeName,offline,idle]"
+ url = settings.CI_SLAVES_URL
json = get_json(url)
if json is not None:
return json['nodes']
@@ -57,7 +60,7 @@ def get_ci_slaves():
def get_all_jobs():
- url = "https://build.opnfv.org/ci/api/json?tree=jobs[displayName,url,lastBuild[fullDisplayName,building,builtOn,timestamp,result]]"
+ url = settings.ALL_JOBS_URL
json = get_json(url)
if json is not None:
return json['jobs'] # return list of dictionaries
@@ -123,7 +126,7 @@ def parse_job_string(full_displayname):
return job
def get_slave_url(slave):
- return 'https://build.opnfv.org/ci/computer/' + slave['displayName']
+ return settings.GET_SLAVE_URL + slave['displayName']
def get_slave_status(slave):