Merge pull request #2523 from dgageot/2510-support-dns-names

FIX 2510 Support DNS names
This commit is contained in:
David Gageot 2015-12-08 10:54:40 +01:00
commit 92854bd31f
2 changed files with 1 additions and 8 deletions

View File

@ -2,8 +2,6 @@ package drivers
import (
"errors"
"fmt"
"net"
"path/filepath"
)
@ -41,10 +39,6 @@ func (d *BaseDriver) GetIP() (string, error) {
if d.IPAddress == "" {
return "", errors.New("IP address is not set")
}
ip := net.ParseIP(d.IPAddress)
if ip == nil {
return "", fmt.Errorf("IP address is invalid: %s", d.IPAddress)
}
return d.IPAddress, nil
}

View File

@ -2,7 +2,6 @@ package drivers
import (
"errors"
"fmt"
"testing"
"github.com/stretchr/testify/assert"
@ -18,7 +17,7 @@ func TestIP(t *testing.T) {
{&BaseDriver{IPAddress: "2001:4860:0:2001::68"}, "2001:4860:0:2001::68", nil},
{&BaseDriver{IPAddress: "192.168.0.1"}, "192.168.0.1", nil},
{&BaseDriver{IPAddress: "::1"}, "::1", nil},
{&BaseDriver{IPAddress: "whatever"}, "", fmt.Errorf("IP address is invalid: %s", "whatever")},
{&BaseDriver{IPAddress: "hostname"}, "hostname", nil},
}
for _, c := range cases {