Fix item being ignored in get_info

This, I think, would've caused get_all_jobs to loop indefinitely if the
Jenkins instance has folders. Am I really the first to have caught this?

Change-Id: I4158b0d068135de08a3337486d8a4b41d8b7cda6
This commit is contained in:
Tomas Janousek 2018-08-03 19:17:47 +02:00
parent 4150a83d45
commit fc953ee505
2 changed files with 2 additions and 2 deletions

View File

@ -770,7 +770,7 @@ class Jenkins(object):
url += query
try:
return json.loads(self.jenkins_open(
requests.Request('GET', self._build_url(INFO))
requests.Request('GET', self._build_url(url))
))
except (req_exc.HTTPError, BadStatusLine):
raise BadHTTPException("Error communicating with server[%s]"

View File

@ -25,7 +25,7 @@ class JenkinsGetJobsTest(JenkinsGetJobsTestBase):
self.assertEqual(job_info, [jobs])
self.assertEqual(
jenkins_mock.call_args[0][0].url,
self.make_url('api/json'))
self.make_url('api/json?tree=jobs[url,color,name,jobs]'))
self._check_requests(jenkins_mock.call_args_list)
@patch.object(jenkins.Jenkins, 'jenkins_open')