From 1dd519a7e6a2f8ae9ed564d3e20b0f3a2af0eb65 Mon Sep 17 00:00:00 2001 From: Christian Goll Date: Mon, 18 Jul 2022 15:04:32 +0200 Subject: [PATCH] clean up and linting fix --- internal/app/wwctl/profile/add/main.go | 2 +- internal/pkg/api/node/node.go | 10 ---------- internal/pkg/node/constructors.go | 2 +- 3 files changed, 2 insertions(+), 12 deletions(-) diff --git a/internal/app/wwctl/profile/add/main.go b/internal/app/wwctl/profile/add/main.go index 8a219a95..fb502fd3 100644 --- a/internal/app/wwctl/profile/add/main.go +++ b/internal/app/wwctl/profile/add/main.go @@ -34,7 +34,7 @@ func CobraRunE(cmd *cobra.Command, args []string) (err error) { if !SetYes { // The checks run twice in the prompt case. // Avoiding putting in a blocking prompt in an API. - apiprofile.AddProfile(&set, false) + err = apiprofile.AddProfile(&set, false) if err != nil { return } diff --git a/internal/pkg/api/node/node.go b/internal/pkg/api/node/node.go index a0f1d4a6..ea16ba69 100644 --- a/internal/pkg/api/node/node.go +++ b/internal/pkg/api/node/node.go @@ -549,16 +549,6 @@ func NodeStatus(nodeNames []string) (nodeStatusResponse *wwapiv1.NodeStatusRespo return } -// checkNetNameRequired is a helper for determining if netname is set. -// Certain settings require it. -func checkNetNameRequired(netname string) (err error) { - if netname == "" { - err = fmt.Errorf("You must include the '--netname' option") - wwlog.Printf(wwlog.ERROR, fmt.Sprintf("%v\n", err.Error())) - } - return -} - /* Add the netname to the options map, as its only known after the map command line options have been read out. diff --git a/internal/pkg/node/constructors.go b/internal/pkg/node/constructors.go index 3e56fb98..5002a32a 100644 --- a/internal/pkg/node/constructors.go +++ b/internal/pkg/node/constructors.go @@ -451,7 +451,7 @@ Return the names of all available profiles */ func (config *NodeYaml) ListAllProfiles() []string { var ret []string - for name, _ := range config.NodeProfiles { + for name := range config.NodeProfiles { ret = append(ret, name) } return ret