drivers/openstack: don't let the driver wait for state

OpenStack driver waits for the machine to reach the expected state. This
is already done in libmachine for most instances of this pattern.

Signed-off-by: Vincent Bernat <Vincent.Bernat@exoscale.ch>
This commit is contained in:
Vincent Bernat 2015-04-11 08:09:10 +02:00
parent 8d5dd50a64
commit 9a4e5254ac
1 changed files with 2 additions and 25 deletions

View File

@ -380,7 +380,7 @@ func (d *Driver) Start() error {
if err := d.client.StartInstance(d); err != nil {
return err
}
return d.waitForInstanceToStart()
return nil
}
func (d *Driver) Stop() error {
@ -392,10 +392,6 @@ func (d *Driver) Stop() error {
return err
}
log.WithField("MachineId", d.MachineId).Info("Waiting for the OpenStack instance to stop...")
if err := d.client.WaitForInstanceStatus(d, "SHUTOFF", 200); err != nil {
return err
}
return nil
}
@ -423,7 +419,7 @@ func (d *Driver) Restart() error {
if err := d.client.RestartInstance(d); err != nil {
return err
}
return d.waitForInstanceToStart()
return nil
}
func (d *Driver) Kill() error {
@ -692,25 +688,6 @@ func (d *Driver) lookForIpAddress() error {
return nil
}
func (d *Driver) waitForSSHServer() error {
ip, err := d.GetIP()
if err != nil {
return err
}
log.WithFields(log.Fields{
"MachineId": d.MachineId,
"IP": ip,
}).Debug("Waiting for the SSH server to be started...")
return ssh.WaitForTCP(fmt.Sprintf("%s:%d", ip, d.SSHPort))
}
func (d *Driver) waitForInstanceToStart() error {
if err := d.waitForInstanceActive(); err != nil {
return err
}
return d.waitForSSHServer()
}
func (d *Driver) publicSSHKeyPath() string {
return d.GetSSHKeyPath() + ".pub"
}