Merge pull request #1100 from hairyhenderson/softlayer-getip-private-fix-1099

Fixing bug in GetIP where Public IP would always be returned
This commit is contained in:
Evan Hazlett 2015-05-04 12:31:49 -07:00
commit cab881ee16
1 changed files with 5 additions and 1 deletions

View File

@ -275,7 +275,11 @@ func (d *Driver) GetIP() (string, error) {
if d.IPAddress != "" { if d.IPAddress != "" {
return d.IPAddress, nil return d.IPAddress, nil
} }
if d.deviceConfig.PrivateNet {
return d.getClient().VirtualGuest().GetPrivateIp(d.Id)
} else {
return d.getClient().VirtualGuest().GetPublicIp(d.Id) return d.getClient().VirtualGuest().GetPublicIp(d.Id)
}
} }
func (d *Driver) GetState() (state.State, error) { func (d *Driver) GetState() (state.State, error) {