Refactor wwctl <node|profile> edit and fix bugs
`wwctl node edit` appears to not be working properly since MergeNode. This refactor, partly towards #918, resolves the issues with `node edit` and updates `profile edit` to match. Signed-off-by: Jonathon Anderson <janderson@ciq.com>
This commit is contained in:
@@ -1,20 +0,0 @@
|
||||
package apinode
|
||||
|
||||
import (
|
||||
"encoding/hex"
|
||||
|
||||
"github.com/warewulf/warewulf/internal/pkg/api/routes/wwapiv1"
|
||||
"github.com/warewulf/warewulf/internal/pkg/node"
|
||||
"github.com/warewulf/warewulf/internal/pkg/wwlog"
|
||||
)
|
||||
|
||||
func Hash() *wwapiv1.NodeDBHash {
|
||||
config, err := node.New()
|
||||
if err != nil {
|
||||
wwlog.Warn("couldb't read config")
|
||||
}
|
||||
hash := config.Hash()
|
||||
return &wwapiv1.NodeDBHash{
|
||||
Hash: hex.EncodeToString(hash[:]),
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user