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

Christian Teklenborg chris at linutronix.de
Fri Dec 6 14:08:49 CET 2019


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>
---
 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




More information about the elbe-devel mailing list