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
006f40f195
commit
0d857d5ab8
|
@ -845,7 +845,7 @@ def disable_vm(zkhandler, domain, force=False):
|
||||||
|
|
||||||
# Get state and perform a shutdown/stop if VM is online
|
# Get state and perform a shutdown/stop if VM is online
|
||||||
current_state = zkhandler.read(("domain.state", dom_uuid))
|
current_state = zkhandler.read(("domain.state", dom_uuid))
|
||||||
if current_state != "stop":
|
if current_state in ["start"]:
|
||||||
if force:
|
if force:
|
||||||
change_state(zkhandler, dom_uuid, "stop")
|
change_state(zkhandler, dom_uuid, "stop")
|
||||||
# Wait for the command to be registered by the node
|
# Wait for the command to be registered by the node
|
||||||
|
|
Loading…
Reference in New Issue