Skip to content

Commit

Permalink
Adding invalid IP '0.0.0.0' checking
Browse files Browse the repository at this point in the history
Fixes janeczku#18

Signed-off-by: Tao Wang <twang2218@gmail.com>
  • Loading branch information
twang2218 committed Jan 14, 2017
1 parent 856be99 commit abb3fb4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions vultr.go
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ func (d *Driver) Create() error {
d.IPAddress = machine.MainIP
d.PrivateIP = machine.InternalIP

if d.IPAddress != "" && d.IPAddress != "0" {
if d.IPAddress != "" && d.IPAddress != "0" && d.IPAddress != "0.0.0.0" {
break
}
log.Debug("IP address not yet available")
Expand Down Expand Up @@ -351,7 +351,7 @@ func (d *Driver) GetURL() (string, error) {
}

func (d *Driver) GetIP() (string, error) {
if d.IPAddress == "" || d.IPAddress == "0" {
if d.IPAddress == "" || d.IPAddress == "0" || d.IPAddress == "0.0.0.0" {
return "", fmt.Errorf("IP address is not set")
}

Expand Down

0 comments on commit abb3fb4

Please sign in to comment.