vmware-iso/driver-esxi: Fix VNC detection of used ports

Fixes error in earlier commit that didn't properly detect a port
  was listened to.
This commit is contained in:
Jason A. Beranek 2014-08-20 20:42:05 -05:00
parent 93e4475d6a
commit ebdfa2bc56
1 changed files with 1 additions and 2 deletions

View File

@ -169,14 +169,13 @@ func (d *ESX5Driver) VNCAddress(portMin, portMax uint) (string, uint, error) {
}
for port := portMin; port <= portMax; port++ {
if _, ok := listenPorts[string(port)]; ok {
if _, ok := listenPorts[fmt.Sprintf("%d", port)]; ok {
log.Printf("Port %d in use", port)
continue
}
address := fmt.Sprintf("%s:%d", d.Host, port)
log.Printf("Trying address: %s...", address)
l, err := net.DialTimeout("tcp", address, 1*time.Second)
log.Printf("Dial complete address: %s...", address)
if err != nil {
if e, ok := err.(*net.OpError); ok {