[PATCH 7/7 v2] Don't raise exceptions from groups, packages properties.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



An empty list is more reasonable for something treated like a normal
attribute.
---
 pyanaconda/packaging/yumpayload.py |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/pyanaconda/packaging/yumpayload.py b/pyanaconda/packaging/yumpayload.py
index 6202a3e..f8e2b20 100644
--- a/pyanaconda/packaging/yumpayload.py
+++ b/pyanaconda/packaging/yumpayload.py
@@ -650,6 +650,7 @@ reposdir=%s
         from yum.Errors import RepoError
         from yum.Errors import GroupsError
 
+        groups = []
         with _yum_lock:
             if not self._groups:
                 if self.needsNetwork and not hasActiveNetDev():
@@ -659,9 +660,11 @@ reposdir=%s
                     self._groups = self._yum.comps
                 except (RepoError, GroupsError) as e:
                     log.error("failed to get group info: %s" % e)
-                    raise MetadataError(e.value)
 
-            return [g.groupid for g in self._groups.get_groups()]
+            if self._groups:
+                groups = [g.groupid for g in self._groups.get_groups()]
+
+        return groups
 
     def description(self, groupid):
         """ Return name/description tuple for the group specified by id. """
@@ -713,7 +716,7 @@ reposdir=%s
                 try:
                     self._packages = self._yum.pkgSack.returnPackages()
                 except RepoError as e:
-                    raise MetadataError(e.value)
+                    log.error("failed to get package list: %s" % e)
 
             return self._packages
 
-- 
1.7.7.6

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list


[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux