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

Manuel Traut manut at linutronix.de
Mon Feb 25 16:18:30 CET 2019


On 17:31 Fri 22 Feb     , bage at linutronix.de wrote:
> 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>
Signed-off-by: Manuel Traut <manut at linutronix.de>
Reviewed-by: Manuel Traut <manut at linutronix.de>

thanks! merged into devel/elbe-3.0

> ---
>  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
> 
> 
> _______________________________________________
> elbe-devel mailing list
> elbe-devel at linutronix.de
> https://lists.linutronix.de/mailman/listinfo/elbe-devel



More information about the elbe-devel mailing list