Escaping required in get_all_jobs() for Jenkins 2.138
Bug #1794133 reported by
Petr Zahradnik
This bug affects 2 people
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Python Jenkins |
New
|
Undecided
|
Unassigned |
Bug Description
while using python-jenkins via jenkins-jobs builder against Jenkins 2.138.1 it fails with:
jenkins.
further investigation reveals that when get_all_jobs() gets called following url is fetched from Jenkins:
http://
which fails with http 400.
The request succeeds if the square brackets are correctly escaped e.g. like this:
http://
this may apply to additional API calls as well.
To post a comment you must log in.
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? url)sjob/ %(short_ name)s/ api/json? tree=allBuilds[ number, url]'
explanation below:
From your suggested fix there is another square bracket not being escaped, ALL_BUILDS = '%(folder_
According to your bug description, this should also be, ALL_BUILDS = '%(folder_ url)sjob/ %(short_ name)s/ api/json? tree=allBuilds% 5Dnumber, url%5D'