diff options
author | Gui Chen <gui.chen@intel.com> | 2012-08-29 17:33:42 +0800 |
---|---|---|
committer | Gui Chen <gui.chen@intel.com> | 2012-08-31 10:48:04 +0800 |
commit | e041e9347a19066ba79bfeb0dd873ae271ff40f1 (patch) | |
tree | ce5dc7045e484700f9547d44b6d94f29bb6aa919 /plugins/backend | |
parent | 595da840c67adfcb5510ac60c0ca9d7e934a5fd3 (diff) | |
download | mic-e041e9347a19066ba79bfeb0dd873ae271ff40f1.tar.gz mic-e041e9347a19066ba79bfeb0dd873ae271ff40f1.tar.bz2 mic-e041e9347a19066ba79bfeb0dd873ae271ff40f1.zip |
resolve proxy issue in yum backend
Signed-off-by: Gui Chen <gui.chen@intel.com>
Diffstat (limited to 'plugins/backend')
-rw-r--r-- | plugins/backend/yumpkgmgr.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/plugins/backend/yumpkgmgr.py b/plugins/backend/yumpkgmgr.py index d677428..063bad4 100644 --- a/plugins/backend/yumpkgmgr.py +++ b/plugins/backend/yumpkgmgr.py @@ -72,6 +72,13 @@ class MyYumRepository(yum.yumRepo.YumRepository): m2c_connection = M2Crypto.SSL.Connection.clientPostConnectionCheck M2Crypto.SSL.Connection.clientPostConnectionCheck = None + proxy = None + proxies = None + if url: + proxy = get_proxy_for(url) + if proxy: + proxies = {str(url.split(':')[0]): str(proxy)} + size = int(size) if size else None rvalue = super(MyYumRepository, self)._getFile(url, relative, @@ -83,7 +90,8 @@ class MyYumRepository(yum.yumRepo.YumRepository): text, reget, cache, - size) + size, + proxies=proxies) if m2c_connection and \ not M2Crypto.SSL.Connection.clientPostConnectionCheck: |