From 8f23422db043a6afb0b2cfd701e3d31f68305933 Mon Sep 17 00:00:00 2001 From: "David J. Allen" Date: Tue, 3 Dec 2024 13:45:54 -0700 Subject: [PATCH] refactor: minor changes --- pkg/generator/warewulf.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pkg/generator/warewulf.go b/pkg/generator/warewulf.go index cbc4129..6e35e55 100644 --- a/pkg/generator/warewulf.go +++ b/pkg/generator/warewulf.go @@ -3,10 +3,12 @@ package generator import ( "fmt" "maps" + "strings" "github.com/OpenCHAMI/configurator/pkg/client" "github.com/OpenCHAMI/configurator/pkg/config" "github.com/OpenCHAMI/configurator/pkg/util" + "github.com/caarlos0/log" ) type Warewulf struct{} @@ -28,6 +30,7 @@ func (g *Warewulf) Generate(config *config.Config, params Params) (FileMap, erro smdClient = client.NewSmdClient(params.ClientOpts...) outputs = make(FileMap, len(params.Templates)) nodeEntries = "" + paths = []string{} ) // 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 if params.Verbose { - fmt.Printf("templates and files loaded: \n") 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 }