[elbe-devel] [PATCH v2 04/10] init: pass cfg into mako templates used to build Makefile and libvirt.xml

Manuel Traut manuel.traut at linutronix.de
Wed Apr 18 16:48:44 CEST 2018


On Tue, Apr 17, 2018 at 12:39:35PM +0200, Torben Hohn wrote:
> the cfg object is not accessible in mako templates.
> 
> This prepares the code to access cfg['initvm_domain'] in libvirt.xml.
> This is needed when we make the libvirt domain of the initvm configurable.
> 
> Signed-off-by: Torben Hohn <torben.hohn at linutronix.de>

Reviewed-by: Manuel Traut <manut at linutronix.de>

and will be added to devel/elbe-3.0

please remember to update your copyright statement in the header. This time,
i'll fix it up manually.

Thanks,

  Manuel


> ---
>  elbepack/commands/init.py | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/elbepack/commands/init.py b/elbepack/commands/init.py
> index fb723abd..39a4ab98 100644
> --- a/elbepack/commands/init.py
> +++ b/elbepack/commands/init.py
> @@ -29,6 +29,7 @@ from elbepack.xmldefaults import ElbeDefaults
>  from elbepack.version import elbe_version
>  from elbepack.templates import write_template, get_initvm_preseed
>  from elbepack.directories import init_template_dir, elbe_dir
> +from elbepack.config import cfg
>  
>  from optparse import OptionParser
>  
> @@ -161,7 +162,8 @@ def run_command(argv):
>           "prj": xml.node("/initvm"),
>           "http_proxy": http_proxy,
>           "pkgs": xml.node("/initvm/pkg-list") or [],
> -         "preseed": get_initvm_preseed(xml)}
> +         "preseed": get_initvm_preseed(xml),
> +         "cfg": cfg}
>  
>      if http_proxy != "":
>          os.putenv("http_proxy", http_proxy)
> -- 
> 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