Skip to content
This repository has been archived by the owner on Feb 9, 2022. It is now read-only.

workaround python-jenkins-0.2.1's build_job() #62

Merged
merged 2 commits into from
Aug 9, 2016

Conversation

ktdreyer
Copy link
Member

@ktdreyer ktdreyer commented Aug 9, 2016

Prior to this change, the system version of Ubuntu Trusty's python-jenkins did not properly submit new jobs to Jenkins. The problem was that Jenkins expected a POST request, and python-jenkins-0.2.1 sent a GET request instead.

To force python-jenkins to send a POST, copy upstream's solution (https://bugs.launchpad.net/python-jenkins/+bug/1177831) and pass an empty string to urllib2's Request constructor. The new _has_broken_build_job() method checks to see if we have a buggy python-jenkins version, and if not, we just fall through to the original behavior (without monkeypatching).

This commit could be reverted if we ever require a newer Ubuntu OS version (like Xenial) with a newer/less-buggy python-jenkins package.

Prior to this change, the system version of Ubuntu Trusty's
python-jenkins did not properly submit new jobs to Jenkins. The problem
was that Jenkins expected a POST request, and python-jenkins-0.2.1 sent
a GET request instead.

To force python-jenkins to send a POST, copy upstream's solution
(https://bugs.launchpad.net/python-jenkins/+bug/1177831) and pass an
empty string to urllib2's Request constructor. The new
"_has_broken_build_job()" method checks to see if we have a buggy
python-jenkins version, and if not, we just fall through to the original
behavior (without monkeypatching).

This commit could be reverted if we ever require a newer Ubuntu OS
version (like Xenial) with a newer/less-buggy python-jenkins package.
I test with 0.2.1 since that's what's in Ubuntu Trusty; older versions
are not supported.
@coveralls
Copy link

coveralls commented Aug 9, 2016

Coverage Status

Coverage increased (+0.1%) to 65.625% when pulling e2088d3 on ktdreyer:python-jenkins-0.2.1 into 523436d on red-hat-storage:master.

@ktdreyer ktdreyer merged commit e2088d3 into red-hat-storage:master Aug 9, 2016
@ktdreyer ktdreyer deleted the python-jenkins-0.2.1 branch August 9, 2016 20:25
@ktdreyer
Copy link
Member Author

ktdreyer commented Aug 9, 2016

@tserlin FYI this will be fixed in v1.1.6

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants