Fix wwct node set profile for single profile

This commit is contained in:
Christian Goll
2022-06-10 13:39:05 +02:00
parent f3c59fc18a
commit 8cd4b0aa02

View File

@@ -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 {