[yum-commits] 2 commits - yum/config.py yum/yumRepo.py
zpavlas at osuosl.org
zpavlas at osuosl.org
Fri Apr 20 07:03:19 UTC 2012
yum/config.py | 4 ++--
yum/yumRepo.py | 6 ++++--
2 files changed, 6 insertions(+), 4 deletions(-)
New commits:
commit fa0157ee37158ea2c528b6aeba50ad07ac3824b3
Author: ZdenÄk Pavlas <zpavlas at redhat.com>
Date: Fri Apr 20 08:59:07 2012 +0200
honor proxy=_none_ again. BZ 814224
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.
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:
commit 0d344d49cdc04d67ee5b654af468a861fcce8555
Author: ZdenÄk Pavlas <zpavlas at redhat.com>
Date: Thu Apr 19 16:42:51 2012 +0200
Revert "honor proxy=_none_ again. BZ 814224"
This reverts commit 1b73d714a6084351d48db5d41abc985239144475.
diff --git a/yum/config.py b/yum/config.py
index 81fe283..fe7e1cb 100644
--- a/yum/config.py
+++ b/yum/config.py
@@ -216,7 +216,7 @@ class UrlOption(Option):
# Handle the "_none_" special case
if url.lower() == '_none_':
if self.allow_none:
- return '_none_'
+ return None
else:
raise ValueError('"_none_" is not a valid value')
diff --git a/yum/yumRepo.py b/yum/yumRepo.py
index ebbbfcc..1abd907 100644
--- a/yum/yumRepo.py
+++ b/yum/yumRepo.py
@@ -433,7 +433,7 @@ class YumRepository(Repository, config.RepoConf):
self._proxy_dict = {} # zap it
proxy_string = None
- empty = (None, '')
+ empty = (None, '_none_', '')
if self.proxy not in empty:
proxy_string = '%s' % self.proxy
if self.proxy_username not in empty:
More information about the Yum-commits
mailing list