Add missing hostlist support for wwctl nodes
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
This commit is contained in:
@@ -39,19 +39,16 @@ func CobraRunE(cmd *cobra.Command, args []string) error {
|
||||
}
|
||||
|
||||
for _, node := range nodes {
|
||||
|
||||
if node.Ipmi.Ipaddr.IsUnspecified() {
|
||||
if node.Ipmi == nil || node.Ipmi.Ipaddr == nil || node.Ipmi.Ipaddr.IsUnspecified() {
|
||||
wwlog.Error("%s: No IPMI IP address", node.Id())
|
||||
continue
|
||||
}
|
||||
ipmiCmd := power.IPMI{IpmiConf: *node.Ipmi}
|
||||
err := ipmiCmd.Console()
|
||||
if err != nil {
|
||||
if err := ipmiCmd.Console(); err != nil {
|
||||
wwlog.Error("%s: Console problem", node.Id())
|
||||
returnErr = err
|
||||
continue
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return returnErr
|
||||
|
||||
@@ -4,10 +4,12 @@ import (
|
||||
"github.com/spf13/cobra"
|
||||
apinode "github.com/warewulf/warewulf/internal/pkg/api/node"
|
||||
"github.com/warewulf/warewulf/internal/pkg/api/routes/wwapiv1"
|
||||
"github.com/warewulf/warewulf/internal/pkg/hostlist"
|
||||
"github.com/warewulf/warewulf/internal/pkg/wwlog"
|
||||
)
|
||||
|
||||
func CobraRunE(cmd *cobra.Command, args []string) error {
|
||||
args = hostlist.Expand(args)
|
||||
filterList := wwapiv1.NodeList{
|
||||
Output: args,
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ func CobraRunE(vars *variables) func(cmd *cobra.Command, args []string) (err err
|
||||
results := make(chan power.IPMI, jobcount)
|
||||
|
||||
for _, node := range nodes {
|
||||
if node.Ipmi.Ipaddr.IsUnspecified() {
|
||||
if node.Ipmi == nil || node.Ipmi.Ipaddr == nil || node.Ipmi.Ipaddr.IsUnspecified() {
|
||||
wwlog.Error("%s: No IPMI IP address", node.Id())
|
||||
continue
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user