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:
parent
5a5e5da663
commit
dd8f07526f
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue