From c269cd7e71c4ec1c0381f7a0244ce0cfbc94ffc5 Mon Sep 17 00:00:00 2001 From: steiler Date: Fri, 4 Sep 2020 13:39:27 +0000 Subject: [PATCH 1/2] code-convention applied --- clab/config.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/clab/config.go b/clab/config.go index 04ff2902d..72617e207 100644 --- a/clab/config.go +++ b/clab/config.go @@ -214,9 +214,9 @@ 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", @@ -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, ", ")) From 40245469f53e437375913d11a48c9668d9cb1b66 Mon Sep 17 00:00:00 2001 From: steiler Date: Fri, 4 Sep 2020 14:21:18 +0000 Subject: [PATCH 2/2] fixed filenames of topology files --- clab/config.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/clab/config.go b/clab/config.go index 72617e207..e56135c1f 100644 --- a/clab/config.go +++ b/clab/config.go @@ -219,9 +219,9 @@ func (c *cLab) NewNode(dutName string, dut dutInfo, idx int) *Node { 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