wwctl commands without NodeInfo

mostly remove Get and calls for the id

Signed-off-by: Christian Goll <cgoll@suse.com>
This commit is contained in:
Christian Goll
2023-12-15 15:40:22 +01:00
committed by Jonathon Anderson
parent 28a7b9fe84
commit 457c7c16b1
47 changed files with 239 additions and 363 deletions

View File

@@ -45,24 +45,24 @@ func CobraRunE(cmd *cobra.Command, args []string) error {
results := make(chan power.IPMI, jobcount)
for _, node := range nodes {
if node.Ipmi.Ipaddr.Get() == "" {
wwlog.Error("%s: No IPMI IP address", node.Id.Get())
if node.Ipmi.Ipaddr.IsUnspecified() {
wwlog.Error("%s: No IPMI IP address", node.Id())
continue
}
var ipmiInterface = "lan"
if node.Ipmi.Interface.Get() != "" {
ipmiInterface = node.Ipmi.Interface.Get()
if node.Ipmi.Interface != "" {
ipmiInterface = node.Ipmi.Interface
}
var ipmiPort = "623"
if node.Ipmi.Port.Get() != "" {
ipmiPort = node.Ipmi.Port.Get()
if node.Ipmi.Port != "" {
ipmiPort = node.Ipmi.Port
}
ipmiCmd := power.IPMI{
NodeName: node.Id.Get(),
HostName: node.Ipmi.Ipaddr.Get(),
NodeName: node.Id(),
HostName: node.Ipmi.Ipaddr.String(),
Port: ipmiPort,
User: node.Ipmi.UserName.Get(),
Password: node.Ipmi.Password.Get(),
User: node.Ipmi.UserName,
Password: node.Ipmi.Password,
Interface: ipmiInterface,
AuthType: "MD5",
}