Skip to content

Commit

Permalink
Merge pull request #31 from steiler/master
Browse files Browse the repository at this point in the history
code-convention applied
  • Loading branch information
hellt authored Sep 4, 2020
2 parents a1cfcf8 + 4024546 commit c8f4ffd
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions clab/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -214,14 +214,14 @@ func (c *cLab) licenseInitialization(dut *dutInfo, kind string) string {

// NewNode initializes a new node object
func (c *cLab) NewNode(dutName string, dut dutInfo, idx int) *Node {
base_config_dir := "/etc/containerlab/templates/srl/"
baseConfigDir := "/etc/containerlab/templates/srl/"

srl_types := map[string]string{
srlTypes := map[string]string{
"ixr6": "topology-7250IXR6.yml",
"ixr10": "topology-7250IXR10.yml",
"ixrd1": "topology-7220IXD1.yml",
"ixrd2": "topology-7220IXD2.yml",
"ixrd3": "topology-7220IXD3.yml",
"ixrd1": "topology-7220IXRD1.yml",
"ixrd2": "topology-7220IXRD2.yml",
"ixrd3": "topology-7220IXRD3.yml",
}

// initialize a new node
Expand Down Expand Up @@ -277,11 +277,11 @@ func (c *cLab) NewNode(dutName string, dut dutInfo, idx int) *Node {
node.NodeType = c.typeInitialization(&dut, node.Kind)


if filename, found := srl_types[node.NodeType]; found {
node.Topology = base_config_dir + filename
if filename, found := srlTypes[node.NodeType]; found {
node.Topology = baseConfigDir + filename
} else {
keys := []string{}
for key, _ := range srl_types {
keys := make([]string, 0, len(srlTypes))
for key, _ := range srlTypes {
keys = append(keys, key)
}
panic("wrong node type; should be " + strings.Join(keys, ", "))
Expand Down

0 comments on commit c8f4ffd

Please sign in to comment.