Skip to content

Commit

Permalink
add more logging
Browse files Browse the repository at this point in the history
  • Loading branch information
mhewedy committed Nov 23, 2020
1 parent 81bacd8 commit 65a71a8
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 0 additions & 4 deletions ip/cidr.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"fmt"
"math"
"net"
"strings"
)

type cidr struct {
Expand Down Expand Up @@ -45,9 +44,6 @@ func getCIDRs() []cidr {
cidrs := make([]cidr, 0)

for _, iface := range ifaces {
if strings.Contains(iface.Name, "VirtualBox") {
continue
}

addrs, err := iface.Addrs()
if err != nil {
Expand Down
1 change: 1 addition & 0 deletions ip/ip.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ func Find(vmName string, purge bool) (string, error) {
var pong bool

if purge {
debug.Log("purge=1, purging...")
ping()
pong = true
}
Expand Down
3 changes: 3 additions & 0 deletions ip/ping.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@ package ip

import (
"github.com/mhewedy/vermin/cmd"
"github.com/mhewedy/vermin/debug"
"sync"
)

func ping() {

cidrs := getCIDRs()
debug.Log("ciders: %s", cidrs)

var wg sync.WaitGroup
wg.Add(len(cidrs))
Expand All @@ -19,6 +21,7 @@ func ping() {
continue
}

debug.Log("pining cider %s", c)
go func(c cidr) {
pingCIDR(c)
wg.Done()
Expand Down

0 comments on commit 65a71a8

Please sign in to comment.