From ffaa518c5a2a792db2abee16a6e80f6995fcfb43 Mon Sep 17 00:00:00 2001 From: Marek Marczykowski Date: Tue, 5 Apr 2011 14:33:51 +0200 Subject: [PATCH] Fix checking if there is AppVMs based on template (#154) --- dom0/qvm-core/qubes.py | 2 +- dom0/qvm-tools/qvm-remove | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dom0/qvm-core/qubes.py b/dom0/qvm-core/qubes.py index 69fcd216..3698ed2d 100755 --- a/dom0/qvm-core/qubes.py +++ b/dom0/qvm-core/qubes.py @@ -1776,7 +1776,7 @@ class QubesVmCollection(dict): def get_vms_based_on(self, template_qid): vms = set([vm for vm in self.values() - if (vm.is_appvm() and vm.template_vm.qid == template_qid)]) + if (vm.template_vm and vm.template_vm.qid == template_qid)]) return vms def get_vms_connected_to(self, netvm_qid): diff --git a/dom0/qvm-tools/qvm-remove b/dom0/qvm-tools/qvm-remove index 50beaf65..e29cb6bd 100755 --- a/dom0/qvm-tools/qvm-remove +++ b/dom0/qvm-tools/qvm-remove @@ -48,7 +48,7 @@ def main(): print "The following AppVMs use '{0}' as a template:".format(vmname) for vm in dependent_vms: print "{name:<12} (qid={qid})".format(qid=vm.qid, name=vm.name) - print "Please remove those VMs first, or use the --force option." + print "Please remove those VMs first." exit (1) if qvm_collection.default_template_qid == vm.qid: qvm_collection.default_template_qid = None