Fixing bug in GetIP where Public IP would always be returned despite use of --softlayer-private-net-only

Signed-off-by: Dave Henderson <Dave.Henderson@ca.ibm.com>
This commit is contained in:
Dave Henderson 2015-05-03 22:14:11 -04:00
parent 6036c28fa5
commit bd35fb3101
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) {