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

@@ -41,24 +41,24 @@ func CobraRunE(cmd *cobra.Command, args []string) error {
for _, node := range nodes {
var primaryNet string
for netName := range node.NetDevs {
if node.NetDevs[netName].Primary.GetB() {
if node.NetDevs[netName].Primary() {
primaryNet = netName
break
}
}
if primaryNet == "" {
wwlog.Error("%s: Primary network device doesn't exist\n", node.Id.Get())
wwlog.Error("%s: Primary network device doesn't exist\n", node.Id())
continue
}
if node.NetDevs[primaryNet].Ipaddr.Get() == "" {
wwlog.Error("%s: Primary network IP address not configured\n", node.Id.Get())
if node.NetDevs[primaryNet].Ipaddr.IsUnspecified() {
wwlog.Error("%s: Primary network IP address not configured\n", node.Id())
continue
}
nodename := node.Id.Print()
nodename := node.Id()
var command []string
command = append(command, node.NetDevs[primaryNet].Ipaddr.Get())
command = append(command, node.NetDevs[primaryNet].Ipaddr.String())
command = append(command, args[1:]...)
batchpool.Submit(func() {