Harmonizing drivers so IPAddress property is kept up-to-date
Signed-off-by: Dave Henderson <Dave.Henderson@ca.ibm.com>
This commit is contained in:
parent
b61b772e73
commit
571852cc6e
|
@ -41,7 +41,7 @@ type Driver struct {
|
||||||
FloatingIpPoolId string
|
FloatingIpPoolId string
|
||||||
SSHUser string
|
SSHUser string
|
||||||
SSHPort int
|
SSHPort int
|
||||||
Ip string
|
IPAddress string
|
||||||
CaCertPath string
|
CaCertPath string
|
||||||
PrivateKeyPath string
|
PrivateKeyPath string
|
||||||
storePath string
|
storePath string
|
||||||
|
@ -278,8 +278,8 @@ func (d *Driver) GetURL() (string, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (d *Driver) GetIP() (string, error) {
|
func (d *Driver) GetIP() (string, error) {
|
||||||
if d.Ip != "" {
|
if d.IPAddress != "" {
|
||||||
return d.Ip, nil
|
return d.IPAddress, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
log.WithField("MachineId", d.MachineId).Debug("Looking for the IP address...")
|
log.WithField("MachineId", d.MachineId).Debug("Looking for the IP address...")
|
||||||
|
@ -663,7 +663,7 @@ func (d *Driver) assignFloatingIp() error {
|
||||||
if err := d.client.AssignFloatingIP(d, floatingIp, portId); err != nil {
|
if err := d.client.AssignFloatingIP(d, floatingIp, portId); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
d.Ip = floatingIp.Ip
|
d.IPAddress = floatingIp.Ip
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -680,7 +680,7 @@ func (d *Driver) lookForIpAddress() error {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
d.Ip = ip
|
d.IPAddress = ip
|
||||||
log.WithFields(log.Fields{
|
log.WithFields(log.Fields{
|
||||||
"IP": ip,
|
"IP": ip,
|
||||||
"MachineId": d.MachineId,
|
"MachineId": d.MachineId,
|
||||||
|
|
Loading…
Reference in New Issue