[elbe-devel] [PATCH v3 04/52] initvmaction: call the preprocessor before "elbe init" is called

dion at linutronix.de dion at linutronix.de
Thu Jun 27 14:44:18 CEST 2019


From: Torben Hohn <torben.hohn at linutronix.de>

the preprocessor was only called for the submit case.
However, <key> urls are not valid anymore, and need to be handled
by the preprocessor.

Use PreprocessWrapper() to call "elbe preprocess" before an xml files
is fed to "elbe init"

Signed-off-by: Torben Hohn <torben.hohn at linutronix.de>
Reviewed-by: Kurt Kanzenbach <kurt at linutronix.de>
---
 elbepack/initvmaction.py | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/elbepack/initvmaction.py b/elbepack/initvmaction.py
index f15b65cd..c7a2b66a 100644
--- a/elbepack/initvmaction.py
+++ b/elbepack/initvmaction.py
@@ -484,13 +484,14 @@ class CreateAction(InitVMAction):
             if not opt.build_sources:
                 init_opts += ' --skip-build-source'
 
-            if cdrom:
-                system('%s init %s --directory "%s" --cdrom "%s" "%s"' %
-                       (elbe_exe, init_opts, initvmdir, cdrom, xmlfile))
-            else:
-                system(
-                    '%s init %s --directory "%s" "%s"' %
-                    (elbe_exe, init_opts, initvmdir, xmlfile))
+            with PreprocessWrapper(xmlfile, opt) as ppw:
+                if cdrom:
+                    system('%s init %s --directory "%s" --cdrom "%s" "%s"' %
+                           (elbe_exe, init_opts, initvmdir, cdrom, ppw.preproc))
+                else:
+                    system(
+                        '%s init %s --directory "%s" "%s"' %
+                        (elbe_exe, init_opts, initvmdir, ppw.preproc))
 
         except CommandError:
             print("'elbe init' Failed", file=sys.stderr)
-- 
2.11.0




More information about the elbe-devel mailing list