fix(webconsole): baremteasl ipmi sol instance_name hide password (#23549)

This commit is contained in:
wanyaoqi
2025-10-16 00:01:59 +08:00
committed by GitHub
parent 23a8fefbd0
commit 6f5feb6a7f
6 changed files with 33 additions and 1 deletions

View File

@@ -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
}