builder/vmware: error if guest IP is blank [GH-189]
This commit is contained in:
parent
8e1e40c096
commit
29279415d0
|
@ -45,6 +45,7 @@ BUG FIXES:
|
||||||
place. [GH-152]
|
place. [GH-152]
|
||||||
* virtualbox: "paused" doesn't mean the VM is stopped, improving
|
* virtualbox: "paused" doesn't mean the VM is stopped, improving
|
||||||
shutdown detection.
|
shutdown detection.
|
||||||
|
* vmware: error if guest IP could not be detected. [GH-189]
|
||||||
|
|
||||||
## 0.1.5 (July 7, 2013)
|
## 0.1.5 (July 7, 2013)
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package vmware
|
package vmware
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"os"
|
"os"
|
||||||
|
@ -68,5 +69,9 @@ func (f *DHCPLeaseGuestLookup) GuestIP() (string, error) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if curIp == "" {
|
||||||
|
return "", errors.New("IP not found for MAC in DHCP leases")
|
||||||
|
}
|
||||||
|
|
||||||
return curIp, nil
|
return curIp, nil
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,6 +47,11 @@ func sshAddress(state map[string]interface{}) (string, error) {
|
||||||
return "", fmt.Errorf("IP lookup failed: %s", err)
|
return "", fmt.Errorf("IP lookup failed: %s", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ipAddress == "" {
|
||||||
|
log.Println("IP is blank, no IP yet.")
|
||||||
|
return "", errors.New("IP is blank")
|
||||||
|
}
|
||||||
|
|
||||||
log.Printf("Detected IP: %s", ipAddress)
|
log.Printf("Detected IP: %s", ipAddress)
|
||||||
return fmt.Sprintf("%s:%d", ipAddress, config.SSHPort), nil
|
return fmt.Sprintf("%s:%d", ipAddress, config.SSHPort), nil
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue