refactor: minor changes

This commit is contained in:
David Allen 2024-12-03 13:45:54 -07:00
parent c5ee0552b4
commit 8f23422db0
Signed by: towk
GPG key ID: 793B2924A49B3A3F

View file

@ -3,10 +3,12 @@ package generator
import ( import (
"fmt" "fmt"
"maps" "maps"
"strings"
"github.com/OpenCHAMI/configurator/pkg/client" "github.com/OpenCHAMI/configurator/pkg/client"
"github.com/OpenCHAMI/configurator/pkg/config" "github.com/OpenCHAMI/configurator/pkg/config"
"github.com/OpenCHAMI/configurator/pkg/util" "github.com/OpenCHAMI/configurator/pkg/util"
"github.com/caarlos0/log"
) )
type Warewulf struct{} type Warewulf struct{}
@ -28,6 +30,7 @@ func (g *Warewulf) Generate(config *config.Config, params Params) (FileMap, erro
smdClient = client.NewSmdClient(params.ClientOpts...) smdClient = client.NewSmdClient(params.ClientOpts...)
outputs = make(FileMap, len(params.Templates)) outputs = make(FileMap, len(params.Templates))
nodeEntries = "" nodeEntries = ""
paths = []string{}
) )
// if we have a client, try making the request for the ethernet interfaces // if we have a client, try making the request for the ethernet interfaces
@ -65,11 +68,11 @@ func (g *Warewulf) Generate(config *config.Config, params Params) (FileMap, erro
// print message if verbose param is found // print message if verbose param is found
if params.Verbose { if params.Verbose {
fmt.Printf("templates and files loaded: \n")
for path, _ := range outputs { for path, _ := range outputs {
fmt.Printf("\t%s", path) paths = append(paths, path)
} }
} }
log.Info().Str("paths", strings.Join(paths, ":")).Msg("templates and files loaded: \n")
return outputs, err return outputs, err
} }