Description of problem: I tried to use f-b-c behind the proxy of my company. It failed. Version-Release number of selected component (if applicable): fedora-business-cards-0.2.2-1.fc10.noarch How reproducible: Always Actual results: f-b-c throws an exception. Expected results: f-b-c should be able to pass through the proxy and get the FAS informations
Can you post an attachment of the exception? CCing python-fedora people.
Also, transparent or non-transparent proxy?
Created attachment 323557 [details] error trace when trying to use f-b-c behind a proxy
I'm not sure what you call a transparent proxy. If that's what you mean, I have to set up the proxy configuration in my client (either the Gnome proxy settings, the Firefox network settings, yum.conf, etc...) in order to access the Internet, so it would be a non-transparent proxy. I attach the trace of the error (not an « exception », but I'm coming from the Java world so my vocabulary might not be the most appropriate for pythonic stuff :)
Do you have proxy settings configured in the environment? In particular the services that python-fedora talks to are all https based. So you'd need to have https_proxy set. env |grep https_proxy Should tell you. I haven't tested this so if there's problems even after you set https_proxy, I'll set up a proxy and see if I can reproduce the error.
Okay, I didn't know about the HTTPS thing. I exported the env var now: $ env | grep http http_proxy=http://172.16.86.98:8080/ https_proxy=http://172.16.86.98:8080 The trace is different now, see attached file.
Created attachment 323596 [details] new error trace
Okay. I did some research and it looks like urllib doesn't support https proxying. I'm looking into integrating some GPL'd code to enable python-fedora to do this now. We also have porting to pycurl on our todo list and that might be another way to fix this.
Created attachment 323700 [details] New proxyclient ported to pycurl new proxyclient ported to pycurl
If you could try the attached proxyclient.py file that would be appreciated. I've tested here with a squid proxy that I setup but I'd like to be sure it works in a real-world situation as well. This proxyclient.py file should replace the existing proxyclient.py in /usr/lib/python2.5/site-packages/fedora/client/proxyclient.py This proxyclient is a port to pycurl so it has some major architectural changes. I need to make one more change to the file and a lot of changes before I'm ready to release this but I've checked it into the devel branch already as it passes the few checks I've made. For the record, the urllib2 hacks I tried failed to work and this port needed to be done at some point in the future anyway.
I did that, now fedora-business-cards doesn't even work: $ fedora-business-cards There was a problem importing the fedora_business_cards module. Please make sure that you have fedora-business-cards installed properly. Just to be sure, here is what I did: # wget https://bugzilla.redhat.com/attachment.cgi?id=323700 # mv attachment.cgi\?id\=323700 proxyclient.py # cp \ /usr/lib/python2.5/site-packages/fedora/client/proxyclient.py \ /usr/lib/python2.5/site-packages/fedora/client/proxyclient.py.backup # mv \ proxyclient.py \ /usr/lib/python2.5/site-packages/fedora/client/proxyclient.py Did I do something incorrectly ?
So we can get a traceback, replace /usr/bin/fedora-business-cards with this: import sys from fedora_business_cards.frontend import cmdline cmdline.main()
Ok, that was because I didn't have pycurl (the traceback revealed this). Now f-b-c works fine. I'll try it on monday when I'm back to work, behind the proxy.
Just tried it this morning. It works great, it could connect to FAS, retrieve my data and I could generate a card. Fixed for me :) Thanks
Excellent. This is checked into the python-fedora-devel branch and will be in the next release.
python-fedora-0.3.8-1.fc10 has been submitted as an update for Fedora 10. http://admin.fedoraproject.org/updates/python-fedora-0.3.8-1.fc10
python-fedora-0.3.8-1.fc10 has been pushed to the Fedora 10 stable repository. If problems still persist, please make note of it in this bug report.