Don't die with attribute error if we can't destroy VM

This commit is contained in:
Joshua Boniface 2018-06-06 11:48:28 -04:00
parent 5edb5d1e77
commit 5ca3f6860b
1 changed files with 4 additions and 1 deletions

View File

@ -96,7 +96,10 @@ class VMInstance:
def stop_vm(self): def stop_vm(self):
print(">>> %s - Forcibly stopping VM" % self.domuuid) print(">>> %s - Forcibly stopping VM" % self.domuuid)
self.instop = True self.instop = True
try:
self.dom.destroy() self.dom.destroy()
except AttributeError:
pass
if self.domuuid in self.thishypervisor.domain_list: if self.domuuid in self.thishypervisor.domain_list:
try: try:
self.thishypervisor.domain_list.remove(self.domuuid) self.thishypervisor.domain_list.remove(self.domuuid)