@@ -12,7 +12,7 @@ import (
|
||||
|
||||
// Holds the variables which are needed in CobraRunE
|
||||
type variables struct {
|
||||
nodeConf node.NodeConf
|
||||
nodeConf node.Node
|
||||
nodeAdd node.NodeConfAdd
|
||||
}
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ func CobraRunE(cmd *cobra.Command, args []string) (err error) {
|
||||
}
|
||||
|
||||
if !SetYes {
|
||||
var nodeList []node.NodeConf
|
||||
var nodeList []node.Node
|
||||
// The checks run twice in the prompt case.
|
||||
// Avoiding putting in a blocking prompt in an API.
|
||||
nodeList, err = apiNode.NodeDeleteParameterCheck(&ndp, false)
|
||||
|
||||
@@ -38,7 +38,7 @@ func CobraRunE(cmd *cobra.Command, args []string) error {
|
||||
Output: args,
|
||||
}
|
||||
nodeListMsg := apinode.FilteredNodes(&filterList)
|
||||
nodeMap := make(map[string]*node.NodeConf)
|
||||
nodeMap := make(map[string]*node.Node)
|
||||
// got proper yaml back
|
||||
_ = yaml.Unmarshal([]byte(nodeListMsg.NodeConfMapYaml), nodeMap)
|
||||
file, err := os.CreateTemp(os.TempDir(), "ww4NodeEdit*.yaml")
|
||||
@@ -50,7 +50,7 @@ func CobraRunE(cmd *cobra.Command, args []string) error {
|
||||
_ = file.Truncate(0)
|
||||
_, _ = file.Seek(0, 0)
|
||||
if !NoHeader {
|
||||
yamlTemplate := node.UnmarshalConf(node.NodeConf{}, []string{"tagsdel"})
|
||||
yamlTemplate := node.UnmarshalConf(node.Node{}, []string{"tagsdel"})
|
||||
_, _ = file.WriteString("#nodename:\n# " + strings.Join(yamlTemplate, "\n# ") + "\n")
|
||||
}
|
||||
_, _ = file.WriteString(nodeListMsg.NodeConfMapYaml)
|
||||
@@ -73,7 +73,7 @@ func CobraRunE(cmd *cobra.Command, args []string) error {
|
||||
wwlog.Debug("Hashes are before %s and after %s\n", sum1, sum2)
|
||||
if sum1 != sum2 {
|
||||
wwlog.Debug("Nodes were modified")
|
||||
modifiedNodeMap := make(map[string]*node.NodeConf)
|
||||
modifiedNodeMap := make(map[string]*node.Node)
|
||||
_, _ = file.Seek(0, 0)
|
||||
// ignore error as only may occurs under strange circumstances
|
||||
buffer, _ := io.ReadAll(file)
|
||||
|
||||
@@ -22,7 +22,7 @@ func CobraRunE(cmd *cobra.Command, args []string) error {
|
||||
}
|
||||
defer file.Close()
|
||||
|
||||
importMap := make(map[string]*node.NodeConf)
|
||||
importMap := make(map[string]*node.Node)
|
||||
buffer, err := io.ReadAll(file)
|
||||
if err != nil {
|
||||
return fmt.Errorf("could not read: %s", err)
|
||||
@@ -64,7 +64,7 @@ func CobraRunE(cmd *cobra.Command, args []string) error {
|
||||
continue
|
||||
}
|
||||
if importMap[line[0]] == nil {
|
||||
importMap[line[0]] = new(node.NodeConf)
|
||||
importMap[line[0]] = new(node.Node)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -496,6 +496,7 @@ nodes:
|
||||
"Interface": "",
|
||||
"EscapeChar": "",
|
||||
"Write": "",
|
||||
"Template": "",
|
||||
"Tags": {}
|
||||
},
|
||||
"Init": "",
|
||||
@@ -545,6 +546,7 @@ nodes:
|
||||
"Interface": "",
|
||||
"EscapeChar": "",
|
||||
"Write": "",
|
||||
"Template": "",
|
||||
"Tags": {}
|
||||
},
|
||||
"Init": "",
|
||||
@@ -578,6 +580,7 @@ nodes:
|
||||
"Interface": "",
|
||||
"EscapeChar": "",
|
||||
"Write": "",
|
||||
"Template": "",
|
||||
"Tags": {}
|
||||
},
|
||||
"Init": "",
|
||||
|
||||
@@ -14,7 +14,7 @@ type variables struct {
|
||||
setNodeAll bool
|
||||
setYes bool
|
||||
setForce bool
|
||||
nodeConf node.NodeConf
|
||||
nodeConf node.Node
|
||||
nodeDel node.NodeConfDel
|
||||
nodeAdd node.NodeConfAdd
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user