From 265dbad6c1c7a8e49011502c5dc4dc87d83a92e5 Mon Sep 17 00:00:00 2001 From: Christian Goll Date: Thu, 17 Mar 2022 12:50:51 +0100 Subject: [PATCH] do not combine overlays any more --- internal/app/wwctl/node/list/main.go | 4 ++-- internal/pkg/node/methods.go | 22 +++++++++++++--------- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/internal/app/wwctl/node/list/main.go b/internal/app/wwctl/node/list/main.go index ddb5b960..4fe66890 100644 --- a/internal/app/wwctl/node/list/main.go +++ b/internal/app/wwctl/node/list/main.go @@ -43,8 +43,8 @@ func CobraRunE(cmd *cobra.Command, args []string) error { fmt.Printf("%-20s %-18s %-12s %s\n", node.Id.Get(), "Container", node.ContainerName.Source(), node.ContainerName.Print()) fmt.Printf("%-20s %-18s %-12s %s\n", node.Id.Get(), "KernelOverride", node.KernelOverride.Source(), node.KernelOverride.Print()) fmt.Printf("%-20s %-18s %-12s %s\n", node.Id.Get(), "KernelArgs", node.KernelArgs.Source(), node.KernelArgs.Print()) - fmt.Printf("%-20s %-18s %-12s %s\n", node.Id.Get(), "SystemOverlay", node.SystemOverlay.Source(), node.SystemOverlay.PrintComb()) - fmt.Printf("%-20s %-18s %-12s %s\n", node.Id.Get(), "RuntimeOverlay", node.RuntimeOverlay.Source(), node.RuntimeOverlay.PrintComb()) + fmt.Printf("%-20s %-18s %-12s %s\n", node.Id.Get(), "SystemOverlay", node.SystemOverlay.Source(), node.SystemOverlay.Print()) + fmt.Printf("%-20s %-18s %-12s %s\n", node.Id.Get(), "RuntimeOverlay", node.RuntimeOverlay.Source(), node.RuntimeOverlay.Print()) fmt.Printf("%-20s %-18s %-12s %s\n", node.Id.Get(), "Ipxe", node.Ipxe.Source(), node.Ipxe.Print()) fmt.Printf("%-20s %-18s %-12s %s\n", node.Id.Get(), "Init", node.Init.Source(), node.Init.Print()) fmt.Printf("%-20s %-18s %-12s %s\n", node.Id.Get(), "Root", node.Root.Source(), node.Root.Print()) diff --git a/internal/pkg/node/methods.go b/internal/pkg/node/methods.go index 118cc59a..5b40739f 100644 --- a/internal/pkg/node/methods.go +++ b/internal/pkg/node/methods.go @@ -3,8 +3,6 @@ package node import ( "regexp" "strings" - - "github.com/hpcng/warewulf/internal/pkg/util" ) /********** @@ -120,19 +118,22 @@ func (ent *Entry) GetReal() string { } /* -Returns a string slice, which is the combination of value, altvalue and def. -The elemtent in the slice are uniq. +Returns a string slice created from a comma seperated list of the value. */ func (ent *Entry) GetSlice() []string { var retval []string if ent.value != "" { - retval = util.SliceAppendUniq(retval, strings.Split(ent.value, ",")) + //retval = util.SliceAppendUniq(retval, strings.Split(ent.value, ",")) + return strings.Split(ent.value, ",") } if ent.altvalue != "" { - retval = util.SliceAppendUniq(retval, strings.Split(ent.altvalue, ",")) + //retval = util.SliceAppendUniq(retval, strings.Split(ent.altvalue, ",")) + return strings.Split(ent.altvalue, ",") } - if ent.def != "" && len(retval) == 0 { - retval = util.SliceAppendUniq(retval, strings.Split(ent.def, ",")) + //if ent.def != "" && len(retval) == 0 { + if ent.def != "" { + //retval = util.SliceAppendUniq(retval, strings.Split(ent.def, ",")) + return strings.Split(ent.def, ",") } return retval @@ -157,13 +158,16 @@ func (ent *Entry) Print() string { return "--" } +/* +Was used for combined stringSlice + func (ent *Entry) PrintComb() string { if ent.value != "" && ent.altvalue != "" { return "[" + ent.value + "," + ent.altvalue + "]" } return ent.Print() } - +*/ func (ent *Entry) PrintB() bool { return ent.GetB() }