Rename NodeConf to NodesConf
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
This commit is contained in:
@@ -14,7 +14,7 @@ import (
|
||||
/*
|
||||
Add a node with the given ID and return a pointer to it
|
||||
*/
|
||||
func (config *NodeYaml) AddNode(nodeID string) (*Node, error) {
|
||||
func (config *NodesYaml) AddNode(nodeID string) (*Node, error) {
|
||||
newNode := NewNode(nodeID)
|
||||
wwlog.Verbose("Adding new node: %s", nodeID)
|
||||
if _, ok := config.Nodes[nodeID]; ok {
|
||||
@@ -28,7 +28,7 @@ func (config *NodeYaml) AddNode(nodeID string) (*Node, error) {
|
||||
/*
|
||||
delete node with the given id
|
||||
*/
|
||||
func (config *NodeYaml) DelNode(nodeID string) error {
|
||||
func (config *NodesYaml) DelNode(nodeID string) error {
|
||||
if _, ok := config.Nodes[nodeID]; !ok {
|
||||
return errors.New("nodename does not exist: " + nodeID)
|
||||
}
|
||||
@@ -42,7 +42,7 @@ func (config *NodeYaml) DelNode(nodeID string) error {
|
||||
/*
|
||||
set node for the node with id the values of vals
|
||||
*/
|
||||
func (config *NodeYaml) SetNode(nodeID string, vals Node) error {
|
||||
func (config *NodesYaml) SetNode(nodeID string, vals Node) error {
|
||||
node, ok := config.Nodes[nodeID]
|
||||
if !ok {
|
||||
return ErrNotFound
|
||||
@@ -61,7 +61,7 @@ func (config *NodeYaml) SetNode(nodeID string, vals Node) error {
|
||||
/*
|
||||
set profile for the node with id the values of vals
|
||||
*/
|
||||
func (config *NodeYaml) SetProfile(profileId string, vals Profile) error {
|
||||
func (config *NodesYaml) SetProfile(profileId string, vals Profile) error {
|
||||
profile, ok := config.NodeProfiles[profileId]
|
||||
if !ok {
|
||||
return ErrNotFound
|
||||
@@ -80,7 +80,7 @@ func (config *NodeYaml) SetProfile(profileId string, vals Profile) error {
|
||||
/*
|
||||
Add a node with the given ID and return a pointer to it
|
||||
*/
|
||||
func (config *NodeYaml) AddProfile(profileId string) (*Profile, error) {
|
||||
func (config *NodesYaml) AddProfile(profileId string) (*Profile, error) {
|
||||
profile := EmptyProfile()
|
||||
wwlog.Verbose("adding new profile: %s", profileId)
|
||||
if _, ok := config.NodeProfiles[profileId]; ok {
|
||||
@@ -94,7 +94,7 @@ func (config *NodeYaml) AddProfile(profileId string) (*Profile, error) {
|
||||
/*
|
||||
delete node with the given id
|
||||
*/
|
||||
func (config *NodeYaml) DelProfile(nodeID string) error {
|
||||
func (config *NodesYaml) DelProfile(nodeID string) error {
|
||||
if _, ok := config.Nodes[nodeID]; !ok {
|
||||
return errors.New("profile does not exist: " + nodeID)
|
||||
}
|
||||
@@ -108,7 +108,7 @@ func (config *NodeYaml) DelProfile(nodeID string) error {
|
||||
/*
|
||||
Write the the NodeYaml to disk.
|
||||
*/
|
||||
func (config *NodeYaml) Persist() error {
|
||||
func (config *NodesYaml) Persist() error {
|
||||
out, dumpErr := config.Dump()
|
||||
if dumpErr != nil {
|
||||
wwlog.Error("%s", dumpErr)
|
||||
@@ -132,7 +132,7 @@ func (config *NodeYaml) Persist() error {
|
||||
Dump returns a YAML document representing the nodeDb
|
||||
instance. Passes through any errors generated by yaml.Marshal.
|
||||
*/
|
||||
func (config *NodeYaml) Dump() ([]byte, error) {
|
||||
func (config *NodesYaml) Dump() ([]byte, error) {
|
||||
// flatten out profiles and nodes
|
||||
for _, val := range config.NodeProfiles {
|
||||
val.Flatten()
|
||||
|
||||
Reference in New Issue
Block a user