From 38ce92563953e52ddff3cedfd8f673eae4313060 Mon Sep 17 00:00:00 2001 From: Gregory Kurtzer Date: Thu, 26 Nov 2020 20:37:28 -0800 Subject: [PATCH] Minor updates/fixes to NodeDB --- internal/pkg/node/constructors.go | 1 + internal/pkg/node/datastructure.go | 1 + internal/pkg/node/methods.go | 4 ++++ 3 files changed, 6 insertions(+) diff --git a/internal/pkg/node/constructors.go b/internal/pkg/node/constructors.go index 11018d65..a0416b86 100644 --- a/internal/pkg/node/constructors.go +++ b/internal/pkg/node/constructors.go @@ -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...) diff --git a/internal/pkg/node/datastructure.go b/internal/pkg/node/datastructure.go index 4ce7acca..cf9d5a04 100644 --- a/internal/pkg/node/datastructure.go +++ b/internal/pkg/node/datastructure.go @@ -85,6 +85,7 @@ type NodeInfo struct { RuntimeOverlay NodeInfoEntry SystemOverlay NodeInfoEntry Profiles []string + GroupProfiles []string NetDevs map[string]*NetDevs } diff --git a/internal/pkg/node/methods.go b/internal/pkg/node/methods.go index dfc25789..39b8d8d5 100644 --- a/internal/pkg/node/methods.go +++ b/internal/pkg/node/methods.go @@ -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 }