mirror of
https://github.com/postmannen/ctrl.git
synced 2024-12-14 12:37:31 +00:00
initial checking for checking for {{data}}
This commit is contained in:
parent
5000d58630
commit
dcbe51a191
2 changed files with 16 additions and 1 deletions
15
requests.go
15
requests.go
|
@ -45,6 +45,7 @@ import (
|
|||
"os/exec"
|
||||
"path/filepath"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/hpcloud/tail"
|
||||
|
@ -1067,6 +1068,20 @@ func (m methodREQCliCommand) handler(proc process, message Message, node string)
|
|||
go func() {
|
||||
defer proc.processes.wg.Done()
|
||||
|
||||
// Check if {{data}} is defined in the arguments. If found put the
|
||||
// data payload there.
|
||||
for i, v := range message.MethodArgs {
|
||||
if strings.Contains(v, "{{data}}") {
|
||||
var s string
|
||||
for _, vv := range message.Data {
|
||||
s = s + vv
|
||||
}
|
||||
|
||||
message.MethodArgs[i] = s
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
c := message.MethodArgs[0]
|
||||
a := message.MethodArgs[1:]
|
||||
|
||||
|
|
Loading…
Reference in a new issue