[yum-commits] Branch 'yum-3_2_X' - yum/__init__.py

skvidal at osuosl.org skvidal at osuosl.org
Tue Oct 19 15:10:53 UTC 2010


 yum/__init__.py |   15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)

New commits:
commit 841bd2dec6baeee45732582f7f489b0e4d5dc2f9
Author: Seth Vidal <skvidal at fedoraproject.org>
Date:   Tue Oct 19 10:52:35 2010 -0400

    make sure we're using the right urlgrabber opts for retrieving gpgkeys for repos.

diff --git a/yum/__init__.py b/yum/__init__.py
index 4596e71..cecdf32 100644
--- a/yum/__init__.py
+++ b/yum/__init__.py
@@ -4236,23 +4236,20 @@ class YumBase(depsolve.Depsolve):
         key_installed = False
 
         self.logger.info(_('Retrieving GPG key from %s') % keyurl)
-
+       
         # Go get the GPG key from the given URL
         try:
             url = misc.to_utf8(keyurl)
             if repo is None:
-                rawkey = urlgrabber.urlread(url, limit=9999)
+                opts = {limit:9999}
+                text = 'global/gpgkey'
             else:
                 #  If we have a repo. use the proxy etc. configuration for it.
                 # In theory we have a global proxy config. too, but meh...
                 # external callers should just update.
-                ug = URLGrabber(bandwidth = repo.bandwidth,
-                                retry = repo.retries,
-                                throttle = repo.throttle,
-                                progress_obj = repo.callback,
-                                proxies=repo.proxy_dict)
-                ug.opts.user_agent = default_grabber.opts.user_agent
-                rawkey = ug.urlread(url, text=repo.id + "/gpgkey")
+                opts = repo._default_grabopts()
+                text = repo.id + '/gpgkey'
+            rawkey = urlgrabber.urlread(url, **opts)
 
         except urlgrabber.grabber.URLGrabError, e:
             raise Errors.YumBaseError(_('GPG key retrieval failed: ') +


More information about the Yum-commits mailing list