[ Agent ] [ Executor ] - fix bugs
This commit is contained in:
@@ -29,15 +29,26 @@ func Execute(em *ExecutionMessage) ([]string, error) {
|
||||
var resultLog []string
|
||||
var err error
|
||||
var realCommand [][]string
|
||||
ok := true
|
||||
|
||||
if strings.HasPrefix(em.Type, "BASE") {
|
||||
// base function
|
||||
resultLog = AgentOsOperatorCache.Command(em.FuncContent[0], em.FuncContent[1:]...)
|
||||
err = nil
|
||||
if len(em.FuncContent) > 1 {
|
||||
ok, resultLog = AgentOsOperatorCache.Exec(em.FuncContent[0], em.FuncContent[1:]...)
|
||||
} else {
|
||||
ok, resultLog = AgentOsOperatorCache.Exec(em.FuncContent[0])
|
||||
}
|
||||
if ok {
|
||||
return resultLog, nil
|
||||
}
|
||||
|
||||
} else if strings.HasPrefix(em.Type, "APP") {
|
||||
// app function
|
||||
ok, resultLog := AgentOsOperatorCache.Deploy(em.FuncContent[0], em.FuncContent[1:]...)
|
||||
if len(em.FuncContent) > 1 {
|
||||
ok, resultLog = AgentOsOperatorCache.Deploy(em.FuncContent[0], em.FuncContent[1:]...)
|
||||
} else {
|
||||
ok, resultLog = AgentOsOperatorCache.Deploy(em.FuncContent[0])
|
||||
}
|
||||
if ok {
|
||||
return resultLog, nil
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user