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