refactor: don't set shape based on unitialised topology

This doesn't make any difference to the outcome - we were simply
setting the shape in the NodeSummary to "", which is what it starts
out as - but looks less weird in the code.
This commit is contained in:
Matthias Radestock
2017-12-23 22:39:08 +00:00
parent d861b41837
commit fc66827af7

View File

@@ -134,14 +134,15 @@ func (n NodeSummary) SummarizeMetrics() NodeSummary {
}
func baseNodeSummary(r report.Report, n report.Node) NodeSummary {
t, _ := r.Topology(n.Topology)
summary := NodeSummary{
ID: n.ID,
Shape: t.GetShape(),
Linkable: true,
Parents: Parents(r, n),
Adjacency: n.Adjacency,
}
if t, ok := r.Topology(n.Topology); ok {
summary.Shape = t.GetShape()
}
if _, ok := n.Counters.Lookup(n.Topology); ok {
// This is a group of nodes, so no metadata, metrics, tables
return summary