[elbe-devel] [PATCH 5/5] Python3: use integer division

Torben Hohn torben.hohn at linutronix.de
Fri Dec 6 17:23:49 CET 2019


On Fri, Dec 06, 2019 at 02:08:49PM +0100, Christian Teklenborg wrote:
> The semantics for / division changed in Python3 so we have to use a // integer
> division here.
> 
> Signed-off-by: Christian Teklenborg <chris at linutronix.de>

Reviewed-by: Torben Hohn <torben.hohn at linutronix.de>

> ---
>  elbepack/init/libvirt.xml.mako | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/elbepack/init/libvirt.xml.mako b/elbepack/init/libvirt.xml.mako
> index cd277f57..cafa385f 100644
> --- a/elbepack/init/libvirt.xml.mako
> +++ b/elbepack/init/libvirt.xml.mako
> @@ -21,7 +21,7 @@ uid = uuid.uuid4()
>  name = cfg['initvm_domain']
>  cpus = int(prj.text('max-cpus', default=defs, key='max-cpus'))
>  cpus = min(multiprocessing.cpu_count(), cpus)
> -memory = size_to_int(prj.text('mem', default=defs, key='mem')) / 1024
> +memory = size_to_int(prj.text('mem', default=defs, key='mem')) // 1024
>  
>  imagetype = prj.text('img', default=defs, key='img')
>  img = os.path.join(opt.directory, 'buildenv.img')
> -- 
> 2.20.1
> 
> 
> _______________________________________________
> elbe-devel mailing list
> elbe-devel at linutronix.de
> https://lists.linutronix.de/mailman/listinfo/elbe-devel

-- 
Torben Hohn
Linutronix GmbH | Bahnhofstrasse 3 | D-88690 Uhldingen-Mühlhofen
Phone: +49 7556 25 999 18; Fax.: +49 7556 25 999 99

Hinweise zum Datenschutz finden Sie hier (Informations on data privacy 
can be found here): https://linutronix.de/kontakt/Datenschutz.php

Linutronix GmbH | Firmensitz (Registered Office): Uhldingen-Mühlhofen | 
Registergericht (Registration Court): Amtsgericht Freiburg i.Br., HRB700 
806 | Geschäftsführer (Managing Directors): Heinz Egger, Thomas Gleixner



More information about the elbe-devel mailing list