From 8cd4b0aa02e3d1aec694e947d92dee80fb6ff7f8 Mon Sep 17 00:00:00 2001 From: Christian Goll Date: Fri, 10 Jun 2022 13:39:05 +0200 Subject: [PATCH] Fix wwct node set profile for single profile --- internal/app/wwctl/node/set/main.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/internal/app/wwctl/node/set/main.go b/internal/app/wwctl/node/set/main.go index b098c53a..86eb563f 100644 --- a/internal/app/wwctl/node/set/main.go +++ b/internal/app/wwctl/node/set/main.go @@ -17,7 +17,6 @@ import ( func CobraRunE(cmd *cobra.Command, args []string) error { var err error var count uint - var SetProfiles []string nodeDB, err := node.New() if err != nil { @@ -154,9 +153,9 @@ func CobraRunE(cmd *cobra.Command, args []string) error { n.Discoverable.SetB(false) } - if len(SetProfiles) > 0 { - wwlog.Printf(wwlog.VERBOSE, "Node: %s, Setting profiles to: %s\n", n.Id.Get(), strings.Join(SetProfiles, ",")) - n.Profiles = SetProfiles + if SetProfile != "" { + wwlog.Printf(wwlog.VERBOSE, "Node: %s, Setting profiles to: %s\n", n.Id.Get(), SetProfile) + n.Profiles = []string{SetProfile} } if len(SetAddProfile) > 0 {