[Yum-devel] [PATCH] Make empty proxy/proxy_username mean the same as unset/_none_. BZ 709188.

tim.lauridsen at gmail.com tim.lauridsen at gmail.com
Thu Jun 2 15:29:27 UTC 2011


On Wed, Jun 1, 2011 at 11:17 PM, James Antill <james at and.org> wrote:

> ---
>  yum/yumRepo.py |    7 ++++---
>  1 files changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/yum/yumRepo.py b/yum/yumRepo.py
> index 1568c54..e5e9ece 100644
> --- a/yum/yumRepo.py
> +++ b/yum/yumRepo.py
> @@ -430,9 +430,10 @@ class YumRepository(Repository, config.RepoConf):
>
>         self._proxy_dict = {} # zap it
>         proxy_string = None
> -        if self.proxy not in [None, '_none_']:
> +        empty = (None, '_none_', '')
> +        if self.proxy not in empty:
>             proxy_string = '%s' % self.proxy
> -            if self.proxy_username is not None:
> +            if self.proxy_username not in empty:
>                 proxy_parsed = urlparse.urlsplit(self.proxy,
> allow_fragments=0)
>                 proxy_proto = proxy_parsed[0]
>                 proxy_host = proxy_parsed[1]
> @@ -445,7 +446,7 @@ class YumRepository(Repository, config.RepoConf):
>                 proxy_string = '%s://%s@%s%s' % (proxy_proto,
>                         self.proxy_username, proxy_host, proxy_rest)
>
> -                if self.proxy_password is not None:
> +                if self.proxy_password not in empty:
>                     proxy_string = '%s://%s:%s@%s%s' % (proxy_proto,
>                               self.proxy_username, self.proxy_password,
>                               proxy_host, proxy_rest)
> --
> 1.7.5.2
>
> _______________________________________________
> Yum-devel mailing list
> Yum-devel at lists.baseurl.org
> http://lists.baseurl.org/mailman/listinfo/yum-devel
>

ACK
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.baseurl.org/pipermail/yum-devel/attachments/20110602/2f44e96e/attachment.html>


More information about the Yum-devel mailing list