added profile set over API
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
package node
|
||||
package apinode
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
@@ -477,7 +477,7 @@ func NodeSet(set *wwapiv1.NodeSetParameter) (err error) {
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
return nodeDbSave(&nodeDB)
|
||||
return DbSave(&nodeDB)
|
||||
}
|
||||
|
||||
// NodeSetParameterCheck does error checking on NodeSetParameter.
|
||||
@@ -658,24 +658,6 @@ func checkNetNameRequired(netname string) (err error) {
|
||||
return
|
||||
}
|
||||
|
||||
// nodeDbSave persists the nodeDB to disk and restarts warewulfd.
|
||||
// TODO: We will likely need locking around anything changing nodeDB
|
||||
// or restarting warewulfd. Determine if the reason for restart is
|
||||
// just to reinitialize warewulfd with the new nodeDB or if there is
|
||||
// something more to it.
|
||||
func nodeDbSave(nodeDB *node.NodeYaml) (err error) {
|
||||
err = nodeDB.Persist()
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "failed to persist nodedb")
|
||||
}
|
||||
|
||||
err = warewulfd.DaemonReload()
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "failed to reload warewulf daemon")
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
/*
|
||||
Add the netname to the options map, as its only known after the map
|
||||
command line options have been read out.
|
||||
|
||||
Reference in New Issue
Block a user