[yum-commits] yum/__init__.py yum/yumRepo.py

zpavlas at osuosl.org zpavlas at osuosl.org
Thu Oct 11 13:41:50 UTC 2012


 yum/__init__.py |    4 ++++
 yum/yumRepo.py  |    4 ++++
 2 files changed, 8 insertions(+)

New commits:
commit 9b70af3011dbd1c70925888c94fb0463e4e1b9b4
Author: Zdeněk Pavlas <zpavlas at redhat.com>
Date:   Wed Oct 10 14:44:37 2012 +0200

    cacheonly: skip repo when group metadata not available.  BZ 864717

diff --git a/yum/__init__.py b/yum/__init__.py
index a1b045f..a159706 100644
--- a/yum/__init__.py
+++ b/yum/__init__.py
@@ -931,6 +931,10 @@ class YumBase(depsolve.Depsolve):
             self.verbose_logger.log(logginglevels.DEBUG_4,
                 _('Adding group file from repository: %s'), repo)
             groupfile = repo.getGroups()
+            if not groupfile:
+                msg = _('Failed to retrieve group file for repository: %s') % repo
+                self.logger.critical(msg)
+                continue
             try:
                 self._comps.add(groupfile)
             except (Errors.GroupsError,Errors.CompsException), e:
diff --git a/yum/yumRepo.py b/yum/yumRepo.py
index 5ab7ff7..e362c43 100644
--- a/yum/yumRepo.py
+++ b/yum/yumRepo.py
@@ -1712,12 +1712,16 @@ Insufficient space in download directory %s
                 try:
                     self.checkMD(local, mdtype)
                 except URLGrabError, e:
+                    if retrieve_can_fail:
+                        return None
                     raise Errors.RepoError, \
                         "Caching enabled and local cache: %s does not match checksum" % local
                 else:
                     return local
 
             else: # ain't there - raise
+                if retrieve_can_fail:
+                    return None
                 raise Errors.RepoError, \
                     "Caching enabled but no local cache of %s from %s" % (local,
                            self.ui_id)


More information about the Yum-commits mailing list