From b91714b204a3b8b1c2bbd16332b45bfcf3cfca55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Mon, 31 Oct 2016 02:04:27 +0100 Subject: [PATCH] qubes/features: handle recursive templates Have features.check_with_template() check the template recursively. The longest path (currently) is: DispVM -> AppVM -> TemplateVM. --- qubes/vm/__init__.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/qubes/vm/__init__.py b/qubes/vm/__init__.py index 54984866..45312695 100644 --- a/qubes/vm/__init__.py +++ b/qubes/vm/__init__.py @@ -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)