[Agent] [Executor] 优化Functional Executor

This commit is contained in:
zeaslity
2023-10-13 17:22:21 +08:00
parent 0a294fa81b
commit 020fc76e05
8 changed files with 215 additions and 150 deletions

View File

@@ -203,9 +203,19 @@ func (op *AgentOsOperator) shutdownFirewall() [][]string {
func (op *AgentOsOperator) shutdownFirewallExec() (bool, []string) {
// quick sort
shutdownFunc := [][]string{
{"systemctl", "stop", "firewalld"},
{"systemctl", "disable", "firewalld"},
{"systemctl", "stop", "ufw"},
{"systemctl", "disable", "ufw"},
{"iptables", "-F"},
}
// 忽略错误
_, resultLog := AllCompleteExecutor(shutdownFunc)
return false, nil
// centos
return true, resultLog
}
func (op *AgentOsOperator) modifyHostname(args []string) [][]string {
@@ -265,7 +275,11 @@ func (op *AgentOsOperator) disableSwap() [][]string {
}
func (op *AgentOsOperator) disableSwapExec() (bool, []string) {
return false, nil
resultOK := true
var resultLog []string
return resultOK, resultLog
}
func (op *AgentOsOperator) removeDocker() [][]string {