Catch invalid XML in links

This commit is contained in:
Stephan Kulow 2022-10-18 21:36:58 +02:00
parent 8dcae5df50
commit 771595ba85

View File

@ -133,7 +133,11 @@ class Importer:
rev = OBSRevision(self.obs, self, project, package).parse(r) rev = OBSRevision(self.obs, self, project, package).parse(r)
if not latest or rev.rev > latest.rev: if not latest or rev.rev > latest.rev:
dbrev = DBRevision.import_obs_rev(db, rev) dbrev = DBRevision.import_obs_rev(db, rev)
try:
root = rev.read_link() root = rev.read_link()
except ET.ParseError:
dbrev.set_broken(db)
continue
if root is not None: if root is not None:
tprj = root.get("project") or project tprj = root.get("project") or project
tpkg = root.get("package") or package tpkg = root.get("package") or package