Jenkins.get_running_builds() Not Working -- Fixed it for you guys
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Python Jenkins |
New
|
Undecided
|
Unassigned |
Bug Description
There was a bug in the get_running_
Here is what the final code I wrote looks like.
Now it works perfectly
I put comments beside what I modified
def get_running_
'''Return list of running builds.
Each build is a dict with keys 'name', 'number', 'url', 'node',
and 'executor'.
:returns: List of builds,
``[ { str: str, str: int, str:str, str: str, str: int} ]``
Example::
>>> builds = server.
>>> print(builds)
'''
builds = []
nodes = self.get_nodes()
for node in nodes:
# the name returned is not the name to lookup when
# dealing with master :/
if node['name'] == 'master':
else:
try:
except JenkinsException as e:
# Jenkins may 500 on depth >0. If the node info comes back
# at depth 0 treat it as a node not running any jobs.
if ('[500]' in str(e) and
for executor in info['executors']:
if executable:
return builds
Would it be possible for you to provide info: /review. openstack. org/#/c/ 353339/
1. python-jenkins version
2. description of the use case that this patch attempts to fix.
3. Is this fix related to change https:/
if #3 does not fix it would it be possible for you to push this patch to Gerrit, our code review system?