[elbe-devel] [PATCH 1/8] elbexml: add get_initvm_primary_mirror()

Manuel Traut manut at linutronix.de
Fri Oct 19 15:57:27 CEST 2018


On Thu, Sep 27, 2018 at 12:34:14PM +0200, Torben Hohn wrote:
> the new buildrepo command needs to obtain the mirror, of the initvm.
> add a function that allows to get it.
> 
> Signed-off-by: Torben Hohn <torben.hohn at linutronix.de>

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


> ---
>  elbepack/elbexml.py | 13 +++++++++++++
>  1 file changed, 13 insertions(+)
> 
> diff --git a/elbepack/elbexml.py b/elbepack/elbexml.py
> index 4eb26b9f..8cda7987 100644
> --- a/elbepack/elbexml.py
> +++ b/elbepack/elbexml.py
> @@ -106,6 +106,19 @@ class ElbeXML(object):
>  
>          return True
>  
> +    def get_initvm_primary_mirror(self, cdrompath):
> +        if self.xml.has("initvm/mirror/primary_host"):
> +            m = self.node("initvm/mirror")
> +
> +            mirror = m.text("primary_proto") + "://"
> +            mirror += m.text("primary_host") + "/"
> +            mirror += m.text("primary_path")
> +
> +        elif self.xml.has("initvm/mirror/cdrom") and cdrompath:
> +            mirror = "file://%s" % cdrompath
> +
> +        return mirror.replace("LOCALMACHINE", "10.0.2.2")
> +
>      def get_primary_mirror(self, cdrompath):
>          if self.prj.has("mirror/primary_host"):
>              m = self.prj.node("mirror")
> -- 
> 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