get_job_config fails when authentication required

Bug #810396 reported by James Page
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Python Jenkins
Fix Released
Medium
Unassigned

Bug Description

When I try to call get_job_config against an Jenkins instance that requires authentication I get the following stacktrace:

Traceback (most recent call last):
  File "./test.py", line 13, in <module>
    print l_jenkins.get_job_config("test_git")
  File "/home/jamespage/src/oneiric/python-jenkins/upstream/python-jenkins/jenkins/__init__.py", line 289, in get_job_config
    return urllib2.urlopen(get_config_url).read()
  File "/usr/lib/python2.7/urllib2.py", line 126, in urlopen
    return _opener.open(url, data, timeout)
  File "/usr/lib/python2.7/urllib2.py", line 400, in open
    response = meth(req, response)
  File "/usr/lib/python2.7/urllib2.py", line 513, in http_response
    'http', request, response, code, msg, hdrs)
  File "/usr/lib/python2.7/urllib2.py", line 438, in error
    return self._call_chain(*args)
  File "/usr/lib/python2.7/urllib2.py", line 372, in _call_chain
    result = func(*args)
  File "/usr/lib/python2.7/urllib2.py", line 521, in http_error_default
    raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
urllib2.HTTPError: HTTP Error 403: Forbidden

Call needs to be wrapped in jenkins_open to ensure that username/password is passed in the request.

Revision history for this message
James Page (james-page) wrote :

This is against the latest revision on trunk.

Revision history for this message
Matthew-gertner (matthew-gertner) wrote :
James Page (james-page)
Changed in python-jenkins:
status: New → Confirmed
importance: Undecided → Medium
James Page (james-page)
Changed in python-jenkins:
status: Confirmed → Fix Committed
James Page (james-page)
Changed in python-jenkins:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.