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.
This commit is contained in:
Joshua Boniface 2021-11-06 04:08:33 -04:00
parent 5a5e5da663
commit dd8f07526f
1 changed files with 1 additions and 1 deletions

View File

@ -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