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

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