[yum-commits] 3 commits - urlgrabber/grabber.py

zpavlas at osuosl.org zpavlas at osuosl.org
Mon Jul 9 11:36:40 UTC 2012


 urlgrabber/grabber.py |   11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

New commits:
commit 0f8630eee377dc6c5470614f85d514f5f6f12067
Author: Zdeněk Pavlas <zpavlas at redhat.com>
Date:   Mon Jul 9 13:32:38 2012 +0200

    Disable Kerberos auth.  BZ 769254
    
    When a proxy supports NEGOTIATE auth scheme but there's
    no valid kerberos ticket, Curl won't use Basic or NTLM,
    although these would succeed.

diff --git a/urlgrabber/grabber.py b/urlgrabber/grabber.py
index b73e297..057cbbe 100644
--- a/urlgrabber/grabber.py
+++ b/urlgrabber/grabber.py
@@ -1379,7 +1379,9 @@ class PyCurlFileObject(object):
         # proxy
         if opts.proxy is not None:
             self.curl_obj.setopt(pycurl.PROXY, opts.proxy)
-            self.curl_obj.setopt(pycurl.PROXYAUTH, pycurl.HTTPAUTH_ANY)
+            self.curl_obj.setopt(pycurl.PROXYAUTH,
+                # All but Kerberos.  BZ 769254
+                pycurl.HTTPAUTH_ANY - pycurl.HTTPAUTH_GSSNEGOTIATE)
 
         if opts.username and opts.password:
             if self.scheme in ('http', 'https'):
commit de78f20089f1d56415739d772c52960530e3dc1a
Author: Zdeněk Pavlas <zpavlas at redhat.com>
Date:   Wed Jun 27 16:47:43 2012 +0200

    get retrycode *after* failure_callback has run

diff --git a/urlgrabber/grabber.py b/urlgrabber/grabber.py
index 071146c..b73e297 100644
--- a/urlgrabber/grabber.py
+++ b/urlgrabber/grabber.py
@@ -1013,7 +1013,6 @@ class URLGrabber(object):
             # beware of infinite loops :)
             tries = tries + 1
             exception = None
-            retrycode = None
             callback  = None
             if DEBUG: DEBUG.info('attempt %i/%s: %s',
                                  tries, opts.retry, args[0])
@@ -1024,7 +1023,6 @@ class URLGrabber(object):
             except URLGrabError, e:
                 exception = e
                 callback = opts.failure_callback
-                retrycode = e.errno
             except KeyboardInterrupt, e:
                 exception = e
                 callback = opts.interrupt_callback
@@ -1042,6 +1040,7 @@ class URLGrabber(object):
                 if DEBUG: DEBUG.info('retries exceeded, re-raising')
                 raise
 
+            retrycode = getattr(exception, 'errno', None)
             if (retrycode is not None) and (retrycode not in opts.retrycodes):
                 if DEBUG: DEBUG.info('retrycode (%i) not in list %s, re-raising',
                                      retrycode, opts.retrycodes)
@@ -2170,7 +2169,7 @@ def parallel_wait(meter = 'text'):
                 try: _run_callback(opts.failure_callback, opts)
                 except URLGrabError, ug_err:
                     retry = 0 # no retries
-            if opts.tries < retry and ug_err.args[0] in opts.retrycodes:
+            if opts.tries < retry and ug_err.errno in opts.retrycodes:
                 start(opts, opts.tries + 1) # simple retry
                 continue
 
commit f46a9256836cdbfe82fbfffffd71531fc9a8b977
Author: Zdeněk Pavlas <zpavlas at redhat.com>
Date:   Wed Jun 13 12:02:19 2012 +0200

    interrupt_callback=None: reraise instead of retrying
    
    When yum fetches metalink.xml with _getMetalink(), we use
    interrupt_callback=None and retry=10.  Ctrl-C then starts
    a new attempt, and user has to abort it 10 times.

diff --git a/urlgrabber/grabber.py b/urlgrabber/grabber.py
index 172e564..071146c 100644
--- a/urlgrabber/grabber.py
+++ b/urlgrabber/grabber.py
@@ -1028,6 +1028,8 @@ class URLGrabber(object):
             except KeyboardInterrupt, e:
                 exception = e
                 callback = opts.interrupt_callback
+                if not callback:
+                    raise
 
             if DEBUG: DEBUG.info('exception: %s', exception)
             if callback:


More information about the Yum-commits mailing list