Verify values of boolean flags in template config.

This commit is contained in:
WillyPillow 2020-06-30 12:09:22 +08:00
parent 6c7360f25c
commit eda68cce6d

View File

@ -282,14 +282,21 @@ def post_install(args):
# Import qvm-feature tags # Import qvm-feature tags
for key in ( for key in (
'no-monitor-layout', 'no-monitor-layout',
'net.fake-ip',
'net.fake-gateway',
'net.fake-netmask',
'pci-e820-host', 'pci-e820-host',
'linux-stubdom', 'linux-stubdom',
'gui', 'gui',
'gui-emulated' 'gui-emulated'
'qrexec'): 'qrexec'):
if key in conf:
if conf[key] == '1':
vm.features[key] = conf[key]
else:
vm.log.warning(
'ignoring boolean config flags that are not \'1\'')
for key in (
'net.fake-ip',
'net.fake-gateway',
'net.fake-netmask'):
if key in conf: if key in conf:
vm.features[key] = conf[key] vm.features[key] = conf[key]
if 'virt-mode' in conf: if 'virt-mode' in conf: