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):