Don't die with attribute error if we can't destroy VM
This commit is contained in:
parent
5edb5d1e77
commit
5ca3f6860b
|
@ -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
|
||||||
self.dom.destroy()
|
try:
|
||||||
|
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)
|
||||||
|
|
Loading…
Reference in New Issue