Skip to content

Commit

Permalink
rename func
Browse files Browse the repository at this point in the history
  • Loading branch information
karimra committed Oct 2, 2020
1 parent b61251a commit 4f32972
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
4 changes: 1 addition & 3 deletions clab/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ func (c *cLab) CreateNodeDirStructure(node *Node) (err error) {
return nil
}

func (c *cLab) CreateLabOutput() (err error) {
func (c *cLab) CreateHostsFile() {
var v4Hosts []string
var v6Hosts []string
for dutName, node := range c.Nodes {
Expand All @@ -207,13 +207,11 @@ func (c *cLab) CreateLabOutput() (err error) {
v4Hosts = append(v4Hosts, fmt.Sprintf("%s \t\t\t %s\n", node.MgmtIPv4, node.LongName))
v6Hosts = append(v6Hosts, fmt.Sprintf("%s \t\t %s\n", node.MgmtIPv6, node.LongName))
}

}

hosts := append(v4Hosts, v6Hosts...)
createFile(path.Join(c.Dir.Lab, "hosts"), strings.Join(hosts, ""))
log.Infof("Generated hosts filename: %s", path.Join(c.Dir.Lab, "hosts"))
return nil
}

// GenerateConfig generates configuration for the duts
Expand Down
4 changes: 1 addition & 3 deletions cmd/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,7 @@ var deployCmd = &cobra.Command{
}

// show topology output
if err = c.CreateLabOutput(); err != nil {
log.Error(err)
}
c.CreateHostsFile()
return nil
},
}
Expand Down

0 comments on commit 4f32972

Please sign in to comment.