mirror of
https://gitlab.com/fdroid/fdroidserver.git
synced 2024-06-03 06:10:10 +02:00
move host vm warning to main block
This commit is contained in:
parent
bb067055d4
commit
1d4e5952c9
|
@ -104,18 +104,6 @@ config = {
|
|||
'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
|
||||
if os.path.exists('makebuildserver.config.py'):
|
||||
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!')
|
||||
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:
|
||||
main()
|
||||
finally:
|
||||
|
|
Loading…
Reference in New Issue
Block a user