From dd8f07526f741fe65f7c21693156a5ecd2ace61e Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Sat, 6 Nov 2021 04:08:33 -0400 Subject: [PATCH] Use positive check rather than negative Ensure the VM is start before doing shutdown/stop, rather than being stopped. Prevents overwrite of existing disable state and other weirdness. --- daemon-common/vm.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/daemon-common/vm.py b/daemon-common/vm.py index 6e1d66cc..a95f1efc 100644 --- a/daemon-common/vm.py +++ b/daemon-common/vm.py @@ -845,7 +845,7 @@ def disable_vm(zkhandler, domain, force=False): # Get state and perform a shutdown/stop if VM is online current_state = zkhandler.read(("domain.state", dom_uuid)) - if current_state != "stop": + if current_state in ["start"]: if force: change_state(zkhandler, dom_uuid, "stop") # Wait for the command to be registered by the node