From e2b70306e558face4003b3e42e3dcedd6f31949f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Mon, 5 Mar 2018 23:47:33 +0100 Subject: [PATCH] Fix error message when using invalid VM as a template for DispVM Don't crash (producing misleading error) when checking if template_for_dispvms=True. Fixes QubesOS/qubes-issues#3341 --- qubes/vm/dispvm.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qubes/vm/dispvm.py b/qubes/vm/dispvm.py index 4554998e..2179dd9f 100644 --- a/qubes/vm/dispvm.py +++ b/qubes/vm/dispvm.py @@ -82,9 +82,9 @@ class DispVM(qubes.vm.qubesvm.QubesVM): if xml is None: assert template is not None - if not template.template_for_dispvms: + if not getattr(template, 'template_for_dispvms', False): raise qubes.exc.QubesValueError( - 'template for DispVM ({}) needs to have ' + 'template for DispVM ({}) needs to be an AppVM with ' 'template_for_dispvms=True'.format(template.name)) if 'dispid' not in kwargs: