qubes/features: handle recursive templates

Have features.check_with_template() check the template recursively.
The longest path (currently) is: DispVM -> AppVM -> TemplateVM.
This commit is contained in:
Marek Marczykowski-Górecki 2016-10-31 02:04:27 +01:00
parent 8097da7cab
commit b91714b204
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724

View File

@ -127,11 +127,8 @@ class Features(dict):
return self[feature]
if hasattr(self.vm, 'template') and self.vm.template is not None:
try:
return self.vm.template.features[feature]
except KeyError:
# handle default just below
pass
return self.vm.template.features.check_with_template(feature,
default)
if default is self._NO_DEFAULT:
raise KeyError(feature)