these validity checks were causing problems with undefining configurations.

Removing these for now, as we will trust the user with doing the right thing.
This commit is contained in:
Gregory Kurtzer
2021-09-12 14:15:54 -07:00
parent 859bbcc316
commit 60155cf127
2 changed files with 0 additions and 73 deletions

View File

@@ -5,7 +5,6 @@ import (
"os"
"strings"
"github.com/hpcng/warewulf/internal/pkg/container"
"github.com/hpcng/warewulf/internal/pkg/node"
"github.com/hpcng/warewulf/internal/pkg/util"
"github.com/hpcng/warewulf/internal/pkg/warewulfd"
@@ -46,59 +45,6 @@ func CobraRunE(cmd *cobra.Command, args []string) error {
os.Exit(1)
}
if SetContainer != "" {
if container.ValidSource(SetContainer) {
imageFile := container.ImageFile(SetContainer)
if !util.IsFile(imageFile) {
wwlog.Printf(wwlog.ERROR, "Container has not been built: %s\n", SetContainer)
if !SetForce {
os.Exit(1)
}
}
} else {
wwlog.Printf(wwlog.ERROR, "Container does not exist: %s\n", SetContainer)
if !SetForce {
os.Exit(1)
}
}
}
if SetProfile != "" {
profiles, _ := nodeDB.FindAllProfiles()
for _, r := range strings.Split(SetProfile, ",") {
var match bool
for _, p := range profiles {
if p.Id.Get() == r || SetForce {
match = true
SetProfiles = append(SetProfiles, r)
}
}
if !match {
wwlog.Printf(wwlog.WARN, "Requested profile is undefined: %s\n", r)
}
}
}
if len(SetAddProfile) > 0 {
profiles, _ := nodeDB.FindAllProfiles()
for _, r := range SetAddProfile {
var match bool
for _, p := range profiles {
if p.Id.Get() == r || SetForce {
match = true
}
}
if !match {
wwlog.Printf(wwlog.WARN, "Requested profile is undefined: %s\n", r)
SetAddProfile = util.SliceRemoveElement(SetAddProfile, r)
}
}
}
for _, n := range nodes {
wwlog.Printf(wwlog.VERBOSE, "Evaluating node: %s\n", n.Id.Get())