python-jenkins-developers team mailing list archive
-
python-jenkins-developers team
-
Mailing list archive
-
Message #00164
[Bug 1246466] Re: cancel_queue() does not work, must use POST not GET
I honestly don't know. We were using an older version of Jenkins at the
time, and it's possible that they've changed something in Jenkins that
would work around the issue. I'm afraid I don't have any time to look
into it today, but here's the code I overrode with:
def cancel_queue(self, number):
"""
Cancel a queued build. The underlying method has a bug that
renders it non-functional (it tries to do a GET request, when
Jenkins wants a POST). This corrects the error by passing
``data`` to the urllib2.Request constructor.
:param number: The queue ID number to cancel.
"""
req = urllib2.Request(self.server + jenkins.CANCEL_QUEUE %
{'number': number}, data='',
headers={'Referer': self.server})
self.jenkins_open(req)
In any case, the above *does* work, and was necessary because, in my
experimentation at the time, I could not get a queued job to be
canceled.
--
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/1246466
Title:
cancel_queue() does not work, must use POST not GET
Status in Python API for Jenkins:
New
Bug description:
The Jenkins.cancel_queue() method does not actually cancel a queued
item. An investigation revealed that Jenkins (v1.529) wants a POST
rather than a GET, when accessing 'queue/item/%(number)s/cancelQueue'.
To manage notifications about this bug go to:
https://bugs.launchpad.net/python-jenkins/+bug/1246466/+subscriptions
References