From 5a0c201fab34f18e4ea8a65c8d47a1d5309b55be Mon Sep 17 00:00:00 2001 From: Andrew Patrikalakis Date: Thu, 1 Jun 2017 09:53:33 -0400 Subject: [PATCH] Copy initial buildserver CPU/memory configuration to final box Vagrantfile --- fdroidserver/vmtools.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/fdroidserver/vmtools.py b/fdroidserver/vmtools.py index 2b198ed1..97e1c52c 100644 --- a/fdroidserver/vmtools.py +++ b/fdroidserver/vmtools.py @@ -369,6 +369,7 @@ class LibvirtBuildVm(FDroidBuildVm): logger.debug('no output name set for packaging \'%s\',' + 'defaulting to %s', self.srvname, output) storagePool = self.conn.storagePoolLookupByName('default') + domainInfo = self.conn.lookupByName(self.srvname).info() if storagePool: if isfile('metadata.json'): @@ -407,9 +408,11 @@ class LibvirtBuildVm(FDroidBuildVm): libvirt.host = "" libvirt.connect_via_ssh = false libvirt.storage_pool_name = "default" + libvirt.cpus = {cpus} + libvirt.memory = {memory} end - end""") + end""".format_map({'memory': str(int(domainInfo[1] / 1024)), 'cpus': str(domainInfo[3])})) with open('Vagrantfile', 'w') as fp: fp.write(vagrantfile) with tarfile.open(output, 'w:gz') as tar: -- 2.30.2