I've fixed this bug in my installation with a simpler code change. Just add .* to the front of the existing pattern:
m = re.match(r'.*/job/([^/]+)/.*', urlparse(url).path) Line 1153 of Jenkins/__init__.py Running on RHEL 6.4 (Santiago) Python 2.6.6 (r266:84292, Nov 21 2013, 10:50:32) Jenkins 1.625.3 -- You received this bug notification because you are a member of Python Jenkins Developers, which is subscribed to Python Jenkins. https://bugs.launchpad.net/bugs/1650669 Title: Jenkins.get_running_builds() Not Working -- Fixed it for you guys Status in Python Jenkins: New Bug description: There was a bug in the get_running_builds(). The regular expression was not functioning properly and you were looking for m.group(1) instead of m.group(0)... Here is what the final code I wrote looks like. Now it works perfectly I put comments beside what I modified def get_running_builds(self): '''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.get_running_builds() >>> print(builds) [{'node': 'foo-slave', 'url': 'https://localhost/job/test/15/', 'executor': 0, 'name': 'test', 'number': 15}] ''' 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': node_name = '(master)' else: node_name = node['name'] try: info = self.get_node_info(node_name, depth=2) 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 self.get_node_info(node_name, depth=0)): continue else: raise for executor in info['executors']: executable = executor['currentExecutable'] if executable: executor_number = executor['number'] build_number = executable['number'] url = executable['url'] m = re.match(r'.*/job/.*', urlparse(url).path) # --> Changed this job_name = m.group(0) # --> Changed this builds.append({'name': job_name, 'number': build_number, 'url': url, 'node': node_name, 'executor': executor_number}) return builds To manage notifications about this bug go to: https://bugs.launchpad.net/python-jenkins/+bug/1650669/+subscriptions -- Mailing list: https://launchpad.net/~python-jenkins-developers Post to : python-jenkins-developers@lists.launchpad.net Unsubscribe : https://launchpad.net/~python-jenkins-developers More help : https://help.launchpad.net/ListHelp