Merge pull request #4354 from simon3z/master

ovirt: fix IPAddress lookup implementation
This commit is contained in:
roberthbailey 2015-02-11 15:32:03 -08:00
commit 4c4b4261d4

View File

@ -117,7 +117,11 @@ func (v *OVirtCloud) Zones() (cloudprovider.Zones, bool) {
// IPAddress returns the address of a particular machine instance
func (v *OVirtCloud) IPAddress(instance string) (net.IP, error) {
// since the instance now is the IP in the ovirt env, this is trivial no-op
return net.ParseIP(instance), nil
ip, err := net.LookupIP(instance)
if err != nil || len(ip) < 1 {
return nil, fmt.Errorf("cannot find ip address for: %s", instance)
}
return ip[0], nil
}
func getInstancesFromXml(body io.Reader) ([]string, error) {