Skip to content

Commit

Permalink
fix linter complains
Browse files Browse the repository at this point in the history
  • Loading branch information
karimra committed Jun 22, 2021
1 parent cf576d4 commit e30f7ef
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 15 deletions.
2 changes: 1 addition & 1 deletion cert/cert.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ func GenerateRootCa(labCARoot string, csrRootJsonTpl *template.Template, input C

// GenerateCert generates and signs a certificate passed as input and saves the certificate and generated private key by path
// CA used to sign the cert is passed as ca and caKey file paths
func GenerateCert(ca string, caKey string, csrJSONTpl *template.Template, input CertInput, targetPath string) (*Certificates, error) {
func GenerateCert(ca, caKey string, csrJSONTpl *template.Template, input CertInput, targetPath string) (*Certificates, error) {
utils.CreateDirectory(targetPath, 0755)
var err error
csrBuff := new(bytes.Buffer)
Expand Down
2 changes: 1 addition & 1 deletion clab/graph.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func (c *CLab) GenerateGraph(topo string) error {

attr["label"] = nodeName
attr["xlabel"] = node.Config().Kind
if len(strings.TrimSpace(node.Config().Group)) != 0 {
if strings.TrimSpace(node.Config().Group) != "" {
attr["group"] = node.Config().Group
if strings.Contains(node.Config().Group, "bb") {
attr["fillcolor"] = "blue"
Expand Down
5 changes: 1 addition & 4 deletions clab/inventory.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,7 @@ func (c *CLab) GenerateInventories() error {
if err != nil {
return err
}
if err := c.generateAnsibleInventory(f); err != nil {
return err
}
return nil
return c.generateAnsibleInventory(f)
}

// generateAnsibleInventory generates and writes ansible inventory file to w
Expand Down
10 changes: 6 additions & 4 deletions nodes/crpd/crpd.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,12 @@ func (s *crpd) Init(cfg *types.NodeConfig, opts ...nodes.NodeOption) error {
}

// mount config and log dirs
s.cfg.Binds = append(s.cfg.Binds, fmt.Sprint(path.Join(s.cfg.LabDir, "config"), ":/config"))
s.cfg.Binds = append(s.cfg.Binds, fmt.Sprint(path.Join(s.cfg.LabDir, "log"), ":/var/log"))
// mount sshd_config
s.cfg.Binds = append(s.cfg.Binds, fmt.Sprint(path.Join(s.cfg.LabDir, "config/sshd_config"), ":/etc/ssh/sshd_config"))
s.cfg.Binds = append(s.cfg.Binds,
fmt.Sprint(path.Join(s.cfg.LabDir, "config"), ":/config"),
fmt.Sprint(path.Join(s.cfg.LabDir, "log"), ":/var/log"),
// mount sshd_config
fmt.Sprint(path.Join(s.cfg.LabDir, "config/sshd_config"), ":/etc/ssh/sshd_config"),
)

return nil
}
Expand Down
6 changes: 1 addition & 5 deletions nodes/srl/srl.go
Original file line number Diff line number Diff line change
Expand Up @@ -240,9 +240,5 @@ func generateSRLTopologyFile(src, labDir string, index int) error {
return err
}
defer f.Close()

if err = tpl.Execute(f, mac); err != nil {
return err
}
return nil
return tpl.Execute(f, mac)
}

0 comments on commit e30f7ef

Please sign in to comment.