Skip to content

Commit

Permalink
Fix generation of graph for topologies with nodes not beeing assigned…
Browse files Browse the repository at this point in the history
… to a group. (#116)

Co-authored-by: Roman Dodin <[email protected]>
  • Loading branch information
steiler and hellt authored Nov 19, 2020
1 parent c94f6ec commit 632086d
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions clab/graph.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,18 @@ func (c *cLab) GenerateGraph(topo string) error {

attr["label"] = nodeName
attr["xlabel"] = node.Kind
attr["group"] = node.Group

if strings.Contains(node.Group, "bb") {
attr["fillcolor"] = "blue"
attr["color"] = "blue"
attr["fontcolor"] = "white"
} else if strings.Contains(node.Kind, "srl") {
attr["fillcolor"] = "green"
attr["color"] = "green"
attr["fontcolor"] = "black"
if len(strings.TrimSpace(node.Group)) != 0 {
attr["group"] = node.Group
if strings.Contains(node.Group, "bb") {
attr["fillcolor"] = "blue"
attr["color"] = "blue"
attr["fontcolor"] = "white"
} else if strings.Contains(node.Kind, "srl") {
attr["fillcolor"] = "green"
attr["color"] = "green"
attr["fontcolor"] = "black"
}
}

if err := g.AddNode(c.TopoFile.name, node.ShortName, attr); err != nil {
return err
}
Expand Down

0 comments on commit 632086d

Please sign in to comment.