python-jenkins-developers team mailing list archive
-
python-jenkins-developers team
-
Mailing list archive
-
Message #00555
[Bug 1794133] Re: Escaping required in get_all_jobs() for Jenkins 2.138
Hi Petr, I'm not active on this project, but I do like it and use it
sometimes, just a couple comments below to help you out with this
contribution. :)
1. According to the README, patches should be submitted in gerrit,
https://github.com/openstack/python-jenkins#developers
2. do all square brackets need to be escaped or why is it only JOBS_QUERY?
explanation below:
From your suggested fix there is another square bracket not being escaped, ALL_BUILDS = '%(folder_url)sjob/%(short_name)s/api/json?tree=allBuilds[number,url]'
According to your bug description, this should also be, ALL_BUILDS =
'%(folder_url)sjob/%(short_name)s/api/json?tree=allBuilds%5Dnumber,url%5D'
--
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/1794133
Title:
Escaping required in get_all_jobs() for Jenkins 2.138
Status in Python Jenkins:
New
Bug description:
while using python-jenkins via jenkins-jobs builder against Jenkins
2.138.1 it fails with:
jenkins.BadHTTPException: Error communicating with server[http
://jenkins-server/]
further investigation reveals that when get_all_jobs() gets called
following url is fetched from Jenkins:
http://jenkins-server/api/json?tree=jobs[url,color,name,jobs]
which fails with http 400.
The request succeeds if the square brackets are correctly escaped e.g. like this:
http://jenkins-server/api/json?tree=jobs%5Burl,color,name,jobs%5D
this may apply to additional API calls as well.
To manage notifications about this bug go to:
https://bugs.launchpad.net/python-jenkins/+bug/1794133/+subscriptions
References