Return non-zero exit code on profile sub-commands
Signed-off-by: xu yang <xyang@ciq.com>
This commit is contained in:
committed by
Jonathon Anderson
parent
3178e338a7
commit
139b9880a0
@@ -6,7 +6,6 @@ import (
|
||||
|
||||
apiprofile "github.com/warewulf/warewulf/internal/pkg/api/profile"
|
||||
"github.com/warewulf/warewulf/internal/pkg/node"
|
||||
"github.com/warewulf/warewulf/internal/pkg/wwlog"
|
||||
"gopkg.in/yaml.v3"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
@@ -47,8 +46,7 @@ func CobraRunE(vars *variables) func(cmd *cobra.Command, args []string) (err err
|
||||
delete(vars.profileConf.Disks, "UNDEF")
|
||||
buffer, err := yaml.Marshal(vars.profileConf)
|
||||
if err != nil {
|
||||
wwlog.Error("Can't marshall nodeInfo", err)
|
||||
return err
|
||||
return fmt.Errorf("can not marshall nodeInfo: %w", err)
|
||||
}
|
||||
set := wwapiv1.NodeAddParameter{
|
||||
NodeConfYaml: string(buffer[:]),
|
||||
|
||||
Reference in New Issue
Block a user