Fix linting issues

This commit is contained in:
WestleyR
2021-09-06 12:03:04 -07:00
parent 31e9929984
commit 4edc16953e
71 changed files with 470 additions and 363 deletions

View File

@@ -8,6 +8,7 @@ import (
"github.com/hpcng/warewulf/internal/pkg/util"
"github.com/hpcng/warewulf/internal/pkg/wwlog"
"github.com/manifoldco/promptui"
"github.com/pkg/errors"
"github.com/spf13/cobra"
)
@@ -39,7 +40,10 @@ func CobraRunE(cmd *cobra.Command, args []string) error {
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)
nodeDB.NodeUpdate(n)
err := nodeDB.NodeUpdate(n)
if err != nil {
return errors.Wrap(err, "failed to update node")
}
}
}
}
@@ -71,7 +75,10 @@ func CobraRunE(cmd *cobra.Command, args []string) error {
}
if SetYes {
nodeDB.Persist()
err := nodeDB.Persist()
if err != nil {
return errors.Wrap(err, "failed to persist nodedb")
}
} else {
q := fmt.Sprintf("Are you sure you want to delete %d profile(s)", count)
@@ -83,7 +90,10 @@ func CobraRunE(cmd *cobra.Command, args []string) error {
result, _ := prompt.Run()
if result == "y" || result == "yes" {
nodeDB.Persist()
err := nodeDB.Persist()
if err != nil {
return errors.Wrap(err, "failed to persist nodedb")
}
}
}