Skip to content

Commit

Permalink
Update autojenkins/jobs.py
Browse files Browse the repository at this point in the history
Added ability to ignore SSL certificate errors in case Jenkins is behind SSL with self-signed certs.
  • Loading branch information
rdodev committed Nov 1, 2012
1 parent e7f268b commit 51345b2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions autojenkins/jobs.py
Expand Up @@ -66,24 +66,24 @@ def _other_url(self, root, command, *args):
"""
return command.format(root, *args)

def _get(self, url_pattern, *args):
def _get(self, url_pattern, *args, **kwargs):
response = requests.get(self._build_url(url_pattern, *args),
auth=self.auth)
auth=self.auth, verify=kwargs.pop('verify', True))
return _validate(response)

def _post(self, url_pattern, *args):
response = requests.post(self._build_url(url_pattern, *args),
auth=self.auth)
return _validate(response)

def all_jobs(self):
def all_jobs(self,**kwargs):
"""
Get a list of tuples with (name, color) of all jobs in the server.
Color is ``blue``, ``yellow`` or ``red`` depending on build results
(SUCCESS, UNSTABLE or FAILED).
"""
response = self._get(LIST)
response = self._get(LIST, **kwargs)
jobs = eval(response.content).get('jobs', [])
return [(job['name'], job['color']) for job in jobs]

Expand Down

0 comments on commit 51345b2

Please sign in to comment.