reflections for unmarshal
This commit is contained in:
@@ -5,7 +5,6 @@ import (
|
||||
"os"
|
||||
|
||||
"github.com/hpcng/warewulf/internal/pkg/node"
|
||||
"github.com/hpcng/warewulf/internal/pkg/util"
|
||||
"github.com/hpcng/warewulf/internal/pkg/wwlog"
|
||||
"github.com/manifoldco/promptui"
|
||||
"github.com/pkg/errors"
|
||||
@@ -36,10 +35,10 @@ func CobraRunE(cmd *cobra.Command, args []string) error {
|
||||
os.Exit(1)
|
||||
}
|
||||
for _, n := range nodes {
|
||||
for _, np := range n.Profiles {
|
||||
for _, np := range n.Profiles.GetSlice() {
|
||||
if np == r {
|
||||
wwlog.Printf(wwlog.VERBOSE, "Removing profile from node %s: %s\n", n.Id.Get(), r)
|
||||
n.Profiles = util.SliceRemoveElement(n.Profiles, r)
|
||||
n.Profiles.SliceRemoveElement(r)
|
||||
err := nodeDB.NodeUpdate(n)
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "failed to update node")
|
||||
|
||||
Reference in New Issue
Block a user