mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-11-05 06:50:29 +03:00
move host vm warning to main block
This commit is contained in:
parent
bb067055d4
commit
1d4e5952c9
1 changed files with 12 additions and 12 deletions
|
|
@ -104,18 +104,6 @@ config = {
|
||||||
'vm_provider': 'virtualbox',
|
'vm_provider': 'virtualbox',
|
||||||
}
|
}
|
||||||
|
|
||||||
if os.path.isfile('/usr/bin/systemd-detect-virt'):
|
|
||||||
try:
|
|
||||||
virt = subprocess.check_output('/usr/bin/systemd-detect-virt').strip().decode('utf-8')
|
|
||||||
except subprocess.CalledProcessError:
|
|
||||||
virt = 'none'
|
|
||||||
if virt == 'qemu' or virt == 'kvm' or virt == 'bochs':
|
|
||||||
logging.info('Running in a VM guest, defaulting to QEMU/KVM via libvirt')
|
|
||||||
config['vm_provider'] = 'libvirt'
|
|
||||||
elif virt != 'none':
|
|
||||||
logging.info('Running in an unsupported VM guest (%s)!', virt)
|
|
||||||
logging.debug('detected virt: %s', virt)
|
|
||||||
|
|
||||||
# load config file, if present
|
# load config file, if present
|
||||||
if os.path.exists('makebuildserver.config.py'):
|
if os.path.exists('makebuildserver.config.py'):
|
||||||
exec(compile(open('makebuildserver.config.py').read(), 'makebuildserver.config.py', 'exec'), config)
|
exec(compile(open('makebuildserver.config.py').read(), 'makebuildserver.config.py', 'exec'), config)
|
||||||
|
|
@ -689,6 +677,18 @@ if __name__ == '__main__':
|
||||||
logging.critical('This must be run as ./makebuildserver in fdroidserver.git!')
|
logging.critical('This must be run as ./makebuildserver in fdroidserver.git!')
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
|
if os.path.isfile('/usr/bin/systemd-detect-virt'):
|
||||||
|
try:
|
||||||
|
virt = subprocess.check_output('/usr/bin/systemd-detect-virt').strip().decode('utf-8')
|
||||||
|
except subprocess.CalledProcessError:
|
||||||
|
virt = 'none'
|
||||||
|
if virt == 'qemu' or virt == 'kvm' or virt == 'bochs':
|
||||||
|
logging.info('Running in a VM guest, defaulting to QEMU/KVM via libvirt')
|
||||||
|
config['vm_provider'] = 'libvirt'
|
||||||
|
elif virt != 'none':
|
||||||
|
logging.info('Running in an unsupported VM guest (%s)!', virt)
|
||||||
|
logging.debug('detected virt: %s', virt)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
main()
|
main()
|
||||||
finally:
|
finally:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue