diff --git a/internal/pkg/node/constructors.go b/internal/pkg/node/constructors.go index 07f191a4..bfca8880 100644 --- a/internal/pkg/node/constructors.go +++ b/internal/pkg/node/constructors.go @@ -138,7 +138,7 @@ func (config *NodeYaml) FindAllNodes() ([]NodeInfo, error) { if len(n.NetDevs) == 1 { // only way to get the key for key := range node.NetDevs { - n.NetDevs[key].Primary.SetB(true) + n.NetDevs[key].Primary.SetDefaultB(true) } } // backward compatibility diff --git a/internal/pkg/node/methods.go b/internal/pkg/node/methods.go index 8f7ae7dc..aae89df2 100644 --- a/internal/pkg/node/methods.go +++ b/internal/pkg/node/methods.go @@ -166,6 +166,17 @@ func (ent *Entry) SetDefaultSlice(val []string) { } +/* +Set default etry as bool +*/ +func (ent *Entry) SetDefaultB(val bool) { + if val { + ent.def = []string{"true"} + } else { + ent.def = []string{"false"} + } +} + /* Remove a element from a slice */