mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-09-14 15:02:51 +03:00
Copy initial buildserver CPU/memory configuration to final box Vagrantfile
This commit is contained in:
parent
63fd20fff0
commit
5a0c201fab
1 changed files with 4 additions and 1 deletions
|
@ -369,6 +369,7 @@ class LibvirtBuildVm(FDroidBuildVm):
|
||||||
logger.debug('no output name set for packaging \'%s\',' +
|
logger.debug('no output name set for packaging \'%s\',' +
|
||||||
'defaulting to %s', self.srvname, output)
|
'defaulting to %s', self.srvname, output)
|
||||||
storagePool = self.conn.storagePoolLookupByName('default')
|
storagePool = self.conn.storagePoolLookupByName('default')
|
||||||
|
domainInfo = self.conn.lookupByName(self.srvname).info()
|
||||||
if storagePool:
|
if storagePool:
|
||||||
|
|
||||||
if isfile('metadata.json'):
|
if isfile('metadata.json'):
|
||||||
|
@ -407,9 +408,11 @@ class LibvirtBuildVm(FDroidBuildVm):
|
||||||
libvirt.host = ""
|
libvirt.host = ""
|
||||||
libvirt.connect_via_ssh = false
|
libvirt.connect_via_ssh = false
|
||||||
libvirt.storage_pool_name = "default"
|
libvirt.storage_pool_name = "default"
|
||||||
|
libvirt.cpus = {cpus}
|
||||||
|
libvirt.memory = {memory}
|
||||||
|
|
||||||
end
|
end
|
||||||
end""")
|
end""".format_map({'memory': str(int(domainInfo[1] / 1024)), 'cpus': str(domainInfo[3])}))
|
||||||
with open('Vagrantfile', 'w') as fp:
|
with open('Vagrantfile', 'w') as fp:
|
||||||
fp.write(vagrantfile)
|
fp.write(vagrantfile)
|
||||||
with tarfile.open(output, 'w:gz') as tar:
|
with tarfile.open(output, 'w:gz') as tar:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue