mirror of
https://github.com/kubevirt/kubevirt.core.git
synced 2026-05-07 22:02:38 +00:00
fix(kubevirt_vm): Set wait_condition based on running
To properly wait for a state change in the kubevirt_vm module the wait_condition needs to adapted to the state of running. Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
This commit is contained in:
@@ -380,7 +380,14 @@ def main() -> None:
|
||||
module.params["resource_definition"] = render_template(module.params)
|
||||
|
||||
# Set wait_condition to allow waiting for the ready state of the VirtualMachine
|
||||
module.params["wait_condition"] = {"type": "Ready", "status": True}
|
||||
if module.params["running"]:
|
||||
module.params["wait_condition"] = {"type": "Ready", "status": True}
|
||||
else:
|
||||
module.params["wait_condition"] = {
|
||||
"type": "Ready",
|
||||
"status": False,
|
||||
"reason": "VMINotExists",
|
||||
}
|
||||
|
||||
try:
|
||||
runner.run_module(module)
|
||||
|
||||
Reference in New Issue
Block a user