From 67571434a5d483d913b35f800d528f83f02c99d1 Mon Sep 17 00:00:00 2001 From: Joshua Boniface Date: Wed, 6 Jun 2018 11:50:02 -0400 Subject: [PATCH] Improve the logic of the on-delete-stop a bit to avoid spurious stop calls --- VMInstance.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/VMInstance.py b/VMInstance.py index 3b077ada..a4c3b06e 100644 --- a/VMInstance.py +++ b/VMInstance.py @@ -216,8 +216,8 @@ class VMInstance: if running == libvirt.VIR_DOMAIN_RUNNING and self.state == "stop" and self.hypervisor == self.thishypervisor.name and self.instop == False: self.stop_vm() - # We got no state, so the VM is deleted and should be stopped - elif running == libvirt.VIR_DOMAIN_NOSTATE: + # We got no state and the VM isn't told to stop, so the VM is deleted and should be stopped + elif running == libvirt.VIR_DOMAIN_NOSTATE and self.state != "stop" and self.inshutdown == False and self.instop == False: self.stop_vm() # VM should be shut down