Blame SOURCES/BZ-1333353-verifytree-fix-handling-no-comps.patch

085af2
commit 56c7eacd9d0ad9237d05e1393c12d5059edb2c7a
085af2
Author: Michal Domonkos <mdomonko@redhat.com>
085af2
Date:   Mon Oct 23 15:33:13 2017 +0200
085af2
085af2
    verifytree: fix handling of missing comps. BZ 1333353
085af2
    
085af2
    When we have group_command = 'objects' and no comps file, invoking
085af2
    my.comps doesn't raise a GroupsError as we would expect, and we continue
085af2
    to newrepo.getGroups() where we finally traceback.  This commit makes
085af2
    sure we detect that beforehand and fail correctly.
085af2
085af2
diff --git a/verifytree.py b/verifytree.py
085af2
index 6a127cd..7f11f10 100755
085af2
--- a/verifytree.py
085af2
+++ b/verifytree.py
085af2
@@ -237,7 +237,8 @@ def main():
085af2
         try:
085af2
             print "  verifying comps.xml with yum"
085af2
             b = my.comps.compscount
085af2
-        except Errors.GroupsError, e:
085af2
+            comps = newrepo.getGroups()
085af2
+        except (Errors.GroupsError, Errors.RepoMDError):
085af2
             print '  comps file missing or unparseable'
085af2
             report('COMPS','FAILED')
085af2
             retval = retval | BAD_COMPS
085af2
@@ -254,7 +255,6 @@ def main():
085af2
                        'properly installed')
085af2
                 r = 1
085af2
             else:
085af2
-                comps = newrepo.getGroups()
085af2
                 r = os.system("xmllint --noout --nowarning --relaxng %s %s" %
085af2
                     (schema, comps))
085af2
             if r != 0: