From e4016a188927db3d14b4e51394bc05111a533c67 Mon Sep 17 00:00:00 2001 From: Demi Marie Obenour Date: Wed, 9 Jun 2021 13:53:48 -0400 Subject: [PATCH] Use getattr() to access Qubes properties This avoids a traceback from qubesd if one tries to use a DispVM as the template for a DispVM. Fixes QubesOS/qubes-issues#6685. --- qubes/vm/dispvm.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qubes/vm/dispvm.py b/qubes/vm/dispvm.py index 665a6adce..b6e7d6cdc 100644 --- a/qubes/vm/dispvm.py +++ b/qubes/vm/dispvm.py @@ -201,7 +201,7 @@ def from_appvm(cls, appvm, **kwargs): This method modifies :file:`qubes.xml` file. The qube returned is not started. ''' - if not appvm.template_for_dispvms: + if not getattr(appvm, 'template_for_dispvms', False): raise qubes.exc.QubesException( 'Refusing to create DispVM out of this AppVM, because ' 'template_for_dispvms=False')