From 64260f58447a5158b7c6c6647248e8e2c79e649a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Wed, 10 Feb 2016 16:57:23 +0100 Subject: [PATCH] core: handle default template Fixes QubesOS/qubes-issues#1559 --- qubes/__init__.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/qubes/__init__.py b/qubes/__init__.py index ee2e7167..3af0e46c 100644 --- a/qubes/__init__.py +++ b/qubes/__init__.py @@ -1382,6 +1382,11 @@ class Qubes(PropertyHolder): if qid is None: qid = self.domains.get_new_unused_qid() + # handle default template; specifically allow template=None (do not + # override it with default template) + if 'template' not in kwargs and hasattr(cls, 'template'): + kwargs['template'] = self.default_template + return self.domains.add(cls(self, None, qid=qid, **kwargs))