mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-06-08 23:45:40 +08:00
fix(webconsole): baremteasl ipmi sol instance_name hide password (#23549)
This commit is contained in:
@@ -17,6 +17,7 @@ package command
|
||||
import (
|
||||
"fmt"
|
||||
"os/exec"
|
||||
"strings"
|
||||
|
||||
"yunion.io/x/log"
|
||||
|
||||
@@ -73,6 +74,20 @@ func (c *IpmitoolSol) GetCommand() *exec.Cmd {
|
||||
return c.BaseCommand.GetCommand()
|
||||
}
|
||||
|
||||
func (c *IpmitoolSol) GetSafeCommandString() string {
|
||||
cmd := []string{c.BaseCommand.name}
|
||||
i := 0
|
||||
for i < len(c.BaseCommand.args) {
|
||||
cmd = append(cmd, c.BaseCommand.args[i])
|
||||
if c.BaseCommand.args[i] == "-P" {
|
||||
cmd = append(cmd, "******")
|
||||
i += 1
|
||||
}
|
||||
i += 1
|
||||
}
|
||||
return strings.Join(cmd, " ")
|
||||
}
|
||||
|
||||
func (c IpmitoolSol) GetProtocol() string {
|
||||
return PROTOCOL_TTY
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user