[elbe-devel] [PATCH 1/4] elbexml: Improve xml validation messages

Torben Hohn torben.hohn at linutronix.de
Thu Jan 20 16:56:11 CET 2022


When the xml validation fails, it is generally unclear why it fails.
Improve the message.

Signed-off-by: Torben Hohn <torben.hohn at linutronix.de>
---
 elbepack/elbexml.py | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/elbepack/elbexml.py b/elbepack/elbexml.py
index eabd1f2fd..50be33346 100644
--- a/elbepack/elbexml.py
+++ b/elbepack/elbexml.py
@@ -347,6 +347,12 @@ class ElbeXML:
                 usr, passwd = auth.split(':')
                 passman.add_password(None, r["url"], usr, passwd)
             if not self.validate_repo(r):
+                if "srcstr" in r:
+                    raise ValidationError(
+                        ["Repository %s, %s can not be validated" % (r["url"], r["srcstr"])])
+                if "binstr" in r:
+                    raise ValidationError(
+                        ["Repository %s, %s can not be validated" % (r["url"], r["binstr"])])
                 raise ValidationError(
                     ["Repository %s can not be validated" % r["url"]])
 
-- 
2.20.1



More information about the elbe-devel mailing list