use ipmi interface from node.NodeConf

Signed-off-by: Christian Goll <cgoll@suse.com>
This commit is contained in:
Christian Goll
2023-12-05 12:06:57 +01:00
committed by Jonathon Anderson
parent 37bf90c588
commit 10ea0ac78d
11 changed files with 59 additions and 185 deletions

View File

@@ -49,26 +49,10 @@ func CobraRunE(cmd *cobra.Command, args []string) error {
wwlog.Error("%s: No IPMI IP address", node.Id())
continue
}
var ipmiInterface = "lan"
if node.Ipmi.Interface != "" {
ipmiInterface = node.Ipmi.Interface
}
var ipmiPort = "623"
if node.Ipmi.Port != "" {
ipmiPort = node.Ipmi.Port
}
ipmiCmd := power.IPMI{
NodeName: node.Id(),
HostName: node.Ipmi.Ipaddr.String(),
Port: ipmiPort,
User: node.Ipmi.UserName,
Password: node.Ipmi.Password,
Interface: ipmiInterface,
AuthType: "MD5",
}
var conf node.NodeConf
conf.GetFrom(n)
ipmiCmd := power.IPMI{IpmiConf: *conf.Ipmi}
fullFlag := full
batchpool.Submit(func() {
if fullFlag {
//nolint:errcheck
@@ -90,12 +74,12 @@ func CobraRunE(cmd *cobra.Command, args []string) error {
out, err := result.Result()
if err != nil {
wwlog.Error("%s: %s", result.NodeName, out)
wwlog.Error("%s: %s", result.Ipaddr, out)
returnErr = err
continue
}
fmt.Printf("%s:\n%s\n", result.NodeName, out)
fmt.Printf("%s:\n%s\n", result.Ipaddr, out)
}
return returnErr