Allow setting default_template to none
It may make sense to force explicit template choice on VM creation, especially with more restrictive qrexec policy.
This commit is contained in:
parent
4f5687440f
commit
80e57e16be
@ -711,7 +711,8 @@ class Qubes(qubes.PropertyHolder):
|
|||||||
that AppVMs are not connected to the Internet.''')
|
that AppVMs are not connected to the Internet.''')
|
||||||
default_template = qubes.VMProperty('default_template', load_stage=3,
|
default_template = qubes.VMProperty('default_template', load_stage=3,
|
||||||
vmclass=qubes.vm.templatevm.TemplateVM,
|
vmclass=qubes.vm.templatevm.TemplateVM,
|
||||||
doc='Default template for new AppVMs')
|
doc='Default template for new AppVMs',
|
||||||
|
allow_none=True)
|
||||||
updatevm = qubes.VMProperty('updatevm', load_stage=3,
|
updatevm = qubes.VMProperty('updatevm', load_stage=3,
|
||||||
default=None, allow_none=True,
|
default=None, allow_none=True,
|
||||||
doc='''Which VM to use as `yum` proxy for updating AdminVM and
|
doc='''Which VM to use as `yum` proxy for updating AdminVM and
|
||||||
@ -1205,6 +1206,10 @@ class Qubes(qubes.PropertyHolder):
|
|||||||
kwargs['template'] = self.default_dispvm
|
kwargs['template'] = self.default_dispvm
|
||||||
else:
|
else:
|
||||||
kwargs['template'] = self.default_template
|
kwargs['template'] = self.default_template
|
||||||
|
if kwargs['template'] is None:
|
||||||
|
raise qubes.exc.QubesValueError(
|
||||||
|
'Template for the qube not specified, nor default '
|
||||||
|
'template set.')
|
||||||
elif 'template' in kwargs and isinstance(kwargs['template'], str):
|
elif 'template' in kwargs and isinstance(kwargs['template'], str):
|
||||||
kwargs['template'] = self.domains[kwargs['template']]
|
kwargs['template'] = self.domains[kwargs['template']]
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user