This service will be undergoing maintenance at 00:00 UTC, 2016-08-01. It is expected to last about 1 hours
Bug 832944 - RFE: support use of HTTP proxy while connecting to Bugzilla.
RFE: support use of HTTP proxy while connecting to Bugzilla.
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: python-bugzilla (Show other bugs)
rawhide
All All
unspecified Severity medium
: ---
: ---
Assigned To: Will Woods
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-06-18 05:04 EDT by pjp
Modified: 2013-02-16 10:35 EST (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-02-16 10:35:33 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description pjp 2012-06-18 05:04:47 EDT
Description of problem:

Currently, python-bugzilla does NOT support using HTTP proxy to connect to the Bugzilla.


Version-Release number of selected component (if applicable):

  - python-bugzilla-0.7.0
  - python-bugzilla-0.6.2-2.fc16.noarch


How reproducible:

  - Everytime. There is no way to specify HTTP proxy while using the client.

Steps to Reproduce:

  - Following script can be used to connect to the RH bugzilla. It needs
    support to use HTTP proxy.

===
#!/usr/bin/python
#

import os
import sys
import bugzilla

if __name__ == "__main__":

    burl = 'https://bugzilla.redhat.com/xmlrpc.cgi'

    bz = bugzilla.getBugzillaClassForURL(burl)()

    bz.connect(burl)  # http_proxy parameter useful here.

    bz.login('USERNAME', 'PASSWORD')
    bg = bz.createbug(product="Red Hat Enterprise Linux 6", ...)

    bz.logout()
    bz.disconnect()

    sys.exit(0)
===

  
Actual results:

  - Can not connect to RH bugzilla via HTTP proxy.

Expected results:

  - Should connect to RH bugzilla in the presense of HTTP proxy.
Comment 1 Cole Robinson 2012-12-30 17:09:12 EST
There's a bit of code here for enabling this with xmlrpclib:

https://gist.github.com/980961
Comment 2 Cole Robinson 2013-01-31 16:01:32 EST
This seems to 'just work' upstream if you have https_proxy or http_proxy environment variable set, so do:

os.environ["https_proxy"] = http://myproxy

Before initializing bugzilla
Comment 3 pjp 2013-02-01 03:03:50 EST
Upstream python-bugzilla[1] or xmlrpclib[2] ?
---
[1] https://fedorahosted.org/python-bugzilla/
[2] http://docs.python.org/2/library/xmlrpclib.html


I tried with a fake proxy on localhost, does not seem to work.

$ cat /etc/fedora-release 
Fedora release 17 (Beefy Miracle)

$ rpm -qa python-bugzilla
python-bugzilla-0.7.0-1.fc17.noarch

$ vim t.py
===
#!/usr/bin/env python
#

import os
import sys
import bugzilla

if __name__ == "__main__":

    burl = 'https://bugzilla.redhat.com/xmlrpc.cgi'
    os.environ['https_proxy'] = "http://127.0.0.1:8080"

    bz = bugzilla.getBugzillaClassForURL(burl)()
    bz.connect(burl)  # http_proxy parameter useful here.

    bz.login('USERNAME', 'PASSWORD')
    bg = bz.getbug(832944)
    print bg.id, bg.summary

    bz.logout()
    bz.disconnect()

    sys.exit(0)
===

$ nc -4klv 127.0.0.1 8080

$ (export http_proxy="http://127.0.0.1:8080"; python t.py)
$ (export https_proxy="https://127.0.0.1:8080"; python t.py)


the netcat(1) server does not receive any connection/requests.
Comment 4 Cole Robinson 2013-02-01 10:18:10 EST
You need to use python-bugzilla from git:

git clone git://git.fedorahosted.org/git/python-bugzilla.git
cd python-bugzilla
mv /path/to/yourscript .
./yourscript

(I use POST to mean 'patch is available upstream'. MODIFIED means that a fix is committed to fedora, which hasn't happened yet)
Comment 5 Prasad J Pandit 2013-02-04 00:32:02 EST
Oh, I see, thank you. Any idea when is the next release of python-bugzilla expected?
Comment 6 Cole Robinson 2013-02-04 12:24:38 EST
(In reply to comment #5)
> Oh, I see, thank you. Any idea when is the next release of python-bugzilla
> expected?

Likely within the next two weeks.
Comment 7 pjp 2013-02-04 12:42:11 EST
That's cool, thanks so much!
Comment 8 Cole Robinson 2013-02-16 10:35:33 EST
Fixed in python-bugzilla-0.8.0-1.fc19

Note You need to log in before you can comment on or make changes to this bug.