Minor updates/fixes to NodeDB

This commit is contained in:
Gregory Kurtzer
2020-11-26 20:37:28 -08:00
parent 3ab02c3055
commit 38ce925639
3 changed files with 6 additions and 0 deletions

View File

@@ -47,6 +47,7 @@ func (self *nodeYaml) FindAllNodes() ([]NodeInfo, error) {
n.IpmiIpaddr.Set(node.IpmiIpaddr)
n.Profiles = node.Profiles
n.GroupProfiles = group.Profiles
allProfiles = append(allProfiles, group.Profiles...)
allProfiles = append(allProfiles, node.Profiles...)

View File

@@ -85,6 +85,7 @@ type NodeInfo struct {
RuntimeOverlay NodeInfoEntry
SystemOverlay NodeInfoEntry
Profiles []string
GroupProfiles []string
NetDevs map[string]*NetDevs
}

View File

@@ -1,5 +1,7 @@
package node
import "strings"
func (self *NodeInfoEntry) String() string {
if self.value != "" {
return "node=" + self.value
@@ -64,6 +66,8 @@ func (self *NodeInfoEntry) SetProfile(value string) {
func (self *NodeInfoEntry) Set(value string) {
if value == "" {
return
} else if strings.ToUpper(value) == "UNDEF" {
value = ""
}
self.value = value
}