From e0210130daadf912f88499f647fca88b60332d38 Mon Sep 17 00:00:00 2001 From: Wojtek Porczyk Date: Tue, 15 Mar 2016 01:01:24 +0100 Subject: [PATCH] qubes: Fix error in get_vms_based_on() Not every vm has .template attribute. --- qubes/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/qubes/__init__.py b/qubes/__init__.py index 658bb46a..1485c4e4 100644 --- a/qubes/__init__.py +++ b/qubes/__init__.py @@ -489,7 +489,8 @@ class VMCollection(object): def get_vms_based_on(self, template): template = self[template] - return set(vm for vm in self if vm.template == template) + return set(vm for vm in self + if hasattr(vm, 'template') and vm.template == template) def get_vms_connected_to(self, netvm):