Skip to content

Commit

Permalink
remove unnecessary config generation for arista
Browse files Browse the repository at this point in the history
  • Loading branch information
hellt committed Apr 23, 2021
1 parent 36efc0f commit 9c110fb
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 9 deletions.
8 changes: 0 additions & 8 deletions clab/ceos.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,14 +94,6 @@ func (c *CLab) createCEOSFiles(node *Node) error {
CreateDirectory(path.Join(node.LabDir, "flash"), 0777)
cfg := path.Join(node.LabDir, "flash", "startup-config")
node.ResConfig = cfg
if !fileExists(cfg) {
err := node.generateConfig(cfg)
if err != nil {
log.Errorf("node=%s, failed to generate config: %v", node.ShortName, err)
}
} else {
log.Debugf("Config file exists for node %s", node.ShortName)
}

// sysmac is a system mac that is +1 to Ma0 mac
m, err := net.ParseMAC(node.MacAddress)
Expand Down
2 changes: 1 addition & 1 deletion clab/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ func (c *CLab) CreateNodeDirStructure(node *Node) (err error) {

// GenerateConfig generates configuration for the nodes
func (node *Node) generateConfig(dst string) error {
if fileExists(dst) && (node.Config == defaultConfigTemplates[node.Kind]) && node.Kind != "ceos" {
if fileExists(dst) && (node.Config == defaultConfigTemplates[node.Kind]) {
log.Debugf("config file '%s' for node '%s' already exists and will not be generated", dst, node.ShortName)
return nil
}
Expand Down

0 comments on commit 9c110fb

Please sign in to comment.