from jenkinsapi import config
from jenkinsapi.job import Job
+from jenkinsapi.nodes import Nodes
from jenkinsapi.node import Node
from jenkinsapi.queue import Queue
from jenkinsapi.view import View
# This only ever needs to work on the base object
return '%s/createItem' % self.baseurl
+ def get_nodes_url(self):
+ # This only ever needs to work on the base object
+ return '%s/computer' % self.baseurl
+
def get_jobs(self):
"""
Fetch all the build-names on this Jenkins server.
self._poll
return self
+ def get_nodes(self):
+ url = self.get_nodes_url()
+ return Nodes(url, self)
+
def create_view(self, str_view_name, person=None):
"""
Create a view
import logging
import pprint
from jenkinsapi import config
-
+from jenkinsapi.exceptions import JenkinsAPIException
log = logging.getLogger(__name__)
class JenkinsBase(object):
response = requester.get_url(url)
try:
return eval(response.text)
- except SyntaxError:
+ except Exception:
log.exception('Inappropriate content found at %s' % url)
- raise
- except TypeError:
- raise
+ raise JenkinsAPIException('Cannot parse %s' % url)
@classmethod
def python_api_url(cls, url):