[Yum-devel] [PATCH] honor proxy=_none_ again. BZ 814224

Zdeněk Pavlas zpavlas at redhat.com
Thu Apr 19 15:26:24 UTC 2012


After commit b804e8d4fc88d proxy=_none_ evaluates to None (option not set).
Change the default so we can tell it apart.  Pass _none_ as '' to urlgrabber.
---
 yum/config.py  |    2 +-
 yum/yumRepo.py |    4 +++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/yum/config.py b/yum/config.py
index fe7e1cb..6446a6d 100644
--- a/yum/config.py
+++ b/yum/config.py
@@ -735,7 +735,7 @@ class YumConf(StartupConf):
     commands = ListOption()
     exclude = ListOption()
     failovermethod = Option(__main_failovermethod_default__)
-    proxy = UrlOption(schemes=('http', 'ftp', 'https'), allow_none=True)
+    proxy = UrlOption(default=False, schemes=('http', 'ftp', 'https'), allow_none=True)
     proxy_username = Option()
     proxy_password = Option()
     username = Option()
diff --git a/yum/yumRepo.py b/yum/yumRepo.py
index 1abd907..655bbaa 100644
--- a/yum/yumRepo.py
+++ b/yum/yumRepo.py
@@ -434,7 +434,9 @@ class YumRepository(Repository, config.RepoConf):
         self._proxy_dict = {} # zap it
         proxy_string = None
         empty = (None, '_none_', '')
-        if self.proxy not in empty:
+        if self.proxy is None:  # got 'proxy=_none_'
+            proxy_string = ''   # this disables default proxies
+        elif self.proxy:
             proxy_string = '%s' % self.proxy
             if self.proxy_username not in empty:
 
-- 
1.7.4.4



More information about the Yum-devel mailing list