diff --git a/internal/app/wwctl/node/set/main.go b/internal/app/wwctl/node/set/main.go index aeb41367..1e87ce3d 100644 --- a/internal/app/wwctl/node/set/main.go +++ b/internal/app/wwctl/node/set/main.go @@ -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()) diff --git a/internal/app/wwctl/profile/set/main.go b/internal/app/wwctl/profile/set/main.go index 708a8b26..246b7b15 100644 --- a/internal/app/wwctl/profile/set/main.go +++ b/internal/app/wwctl/profile/set/main.go @@ -4,9 +4,7 @@ import ( "fmt" "os" - "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" "github.com/hpcng/warewulf/internal/pkg/wwlog" "github.com/manifoldco/promptui" @@ -44,23 +42,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 name does not exist: %s\n", SetContainer) - if !SetForce { - os.Exit(1) - } - } - } - for _, p := range profiles { wwlog.Printf(wwlog.VERBOSE, "Modifying profile: %s\n", p.Id.Get())