[Excution] - base function accomplish - 4
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"agent-go/executor"
|
||||
"agent-go/g"
|
||||
"agent-go/rabbitmq"
|
||||
"agent-go/register"
|
||||
@@ -184,5 +185,27 @@ func parseAgentServerInfo() *register.AgentServerInfo {
|
||||
}
|
||||
log.Info(fmt.Sprintf("agent server info is %v", string(jsonFormat)))
|
||||
|
||||
// build a operator cache
|
||||
BuildAgentOsOperator(agentServerInfo)
|
||||
|
||||
return agentServerInfo
|
||||
}
|
||||
|
||||
func BuildAgentOsOperator(agentServerInfo *register.AgentServerInfo) {
|
||||
|
||||
executor.AgentOsOperatorCache = &executor.AgentOsOperator{
|
||||
InstallCommandPrefix: nil,
|
||||
RemoveCommandPrefix: nil,
|
||||
CanAccessInternet: false,
|
||||
IsOsTypeUbuntu: false,
|
||||
IsAgentInnerWall: false,
|
||||
AgentArch: "",
|
||||
AgentOSReleaseCode: "",
|
||||
AgentServerInfo: agentServerInfo,
|
||||
}
|
||||
|
||||
// debug
|
||||
marshal, _ := json.Marshal(executor.AgentOsOperatorCache)
|
||||
log.DebugF("cached agent operator is %s", marshal)
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user