From 13e1bd2c2a1c0fd95c5ed58973981b51741374fe Mon Sep 17 00:00:00 2001 From: Carlos Lapao Date: Wed, 6 Nov 2024 10:48:07 +0000 Subject: [PATCH] Fix a bug on execute endpoint - Fixed a bug on the execute endpoint where it would give an error if the command was present but the script was not --- src/models/virtual_machine_execute.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/models/virtual_machine_execute.go b/src/models/virtual_machine_execute.go index 534c986..bf35191 100644 --- a/src/models/virtual_machine_execute.go +++ b/src/models/virtual_machine_execute.go @@ -12,7 +12,7 @@ type VirtualMachineExecuteCommandRequest struct { } func (r *VirtualMachineExecuteCommandRequest) Validate() error { - if r.Command == "" || r.Script == nil { + if r.Command == "" && r.Script == nil { if r.Script == nil { return errors.NewWithCode("missing script", 400) }