qubes/features: handle recursive templates in check_with_template
This is the case for DispVMs: DispVM -> AppVM -> TemplateVM
This commit is contained in:
parent
1a215e47ab
commit
460f0849a7
@ -126,9 +126,12 @@ class Features(dict):
|
|||||||
if feature in self:
|
if feature in self:
|
||||||
return self[feature]
|
return self[feature]
|
||||||
|
|
||||||
if hasattr(self.vm, 'template') and self.vm.template is not None \
|
if hasattr(self.vm, 'template') and self.vm.template is not None:
|
||||||
and feature in self.vm.template.features:
|
try:
|
||||||
return self.vm.template.features[feature]
|
return self.vm.template.features[feature]
|
||||||
|
except KeyError:
|
||||||
|
# handle default just below
|
||||||
|
pass
|
||||||
|
|
||||||
if default is self._NO_DEFAULT:
|
if default is self._NO_DEFAULT:
|
||||||
raise KeyError(feature)
|
raise KeyError(feature)
|
||||||
|
Loading…
Reference in New Issue
Block a user