[elbe-devel] [PATCH] initvm create: less strict XML check on project XML

bage at linutronix.de bage at linutronix.de
Fri Feb 22 17:31:15 CET 2019


From: Bastian Germann <bage at linutronix.de>

On `elbe initvm create project.xml` with project.xml containing variants the
ElbeXML check on the XML file does not do preprocessing and fails.

However, later on the preprocessing is done anyway.
So just use an etree() call instead to do the XML check.
This closes issue #194.

Fix the user facing typo which appears in the bug report.

Signed-off-by: Bastian Germann <bage at linutronix.de>
---
 elbepack/initvmaction.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/elbepack/initvmaction.py b/elbepack/initvmaction.py
index c189abaf..64ce3b73 100644
--- a/elbepack/initvmaction.py
+++ b/elbepack/initvmaction.py
@@ -434,7 +434,7 @@ class CreateAction(InitVMAction):
                 try:
                     xml = etree(xmlfile)
                 except ValidationError as e:
-                    print("XML file is inavlid: %s" % str(e))
+                    print("XML file is invalid: %s" % str(e))
                 # Use default XML if no initvm was specified
                 if not xml.has("initvm"):
                     xmlfile = os.path.join(
@@ -518,9 +518,9 @@ class CreateAction(InitVMAction):
             if args[0].endswith('.xml'):
                 # stop here if no project node was specified
                 try:
-                    x = ElbeXML(args[0])
+                    x = etree(args[0])
                 except ValidationError as e:
-                    print("XML file is inavlid: %s" % str(e))
+                    print("XML file is invalid: %s" % str(e))
                     sys.exit(20)
                 if not x.has('project'):
                     print("elbe initvm ready: use 'elbe initvm submit "
-- 
2.11.0




More information about the elbe-devel mailing list