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

James Antill james at osuosl.org
Fri Oct 17 05:36:50 UTC 2008


 yum/yumRepo.py |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

New commits:
commit fbf463e0584c26b62a9b79f37b57d05bfa9af9cb
Author: James Antill <james at and.org>
Date:   Fri Oct 17 00:33:49 2008 -0400

    Catch repo/mirror errors as w3ell as urlgrabber errors, if we can revert

diff --git a/yum/yumRepo.py b/yum/yumRepo.py
index e851d16..5cf3444 100644
--- a/yum/yumRepo.py
+++ b/yum/yumRepo.py
@@ -868,6 +868,8 @@ class YumRepository(Repository, config.RepoConf):
     def _getFileRepoXML(self, local, text=None, grab_can_fail=None):
         """ Call _getFile() for the repomd.xml file. """
         checkfunc = (self._checkRepoXML, (), {})
+        if grab_can_fail is None:
+            grab_can_fail = 'old_repo_XML' in self._oldRepoMDData
         try:
             result = self._getFile(relative=self.repoMDFile,
                                    local=local,
@@ -878,11 +880,13 @@ class YumRepository(Repository, config.RepoConf):
                                    cache=self.http_caching == 'all')
 
         except URLGrabError, e:
-            if grab_can_fail is None:
-                grab_can_fail = 'old_repo_XML' in self._oldRepoMDData
             if grab_can_fail:
                 return None
             raise Errors.RepoError, 'Error downloading file %s: %s' % (local, e)
+        except (Errors.NoMoreMirrorsRepoError, Errors.RepoError):
+            if grab_can_fail:
+                return None
+            raise
 
 
         return result


More information about the Yum-commits mailing list