From 5ca3f6860b12d99ee585c1e26361ace2588f0c04 Mon Sep 17 00:00:00 2001 From: Joshua Boniface Date: Wed, 6 Jun 2018 11:48:28 -0400 Subject: [PATCH] Don't die with attribute error if we can't destroy VM --- VMInstance.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/VMInstance.py b/VMInstance.py index 6f499674..3b077ada 100644 --- a/VMInstance.py +++ b/VMInstance.py @@ -96,7 +96,10 @@ class VMInstance: def stop_vm(self): print(">>> %s - Forcibly stopping VM" % self.domuuid) self.instop = True - self.dom.destroy() + try: + self.dom.destroy() + except AttributeError: + pass if self.domuuid in self.thishypervisor.domain_list: try: self.thishypervisor.domain_list.remove(self.domuuid)