mirror of https://github.com/docker/docs.git
Merge pull request #597 from ehazlett/no-error-vbox-start
virtualbox: check state before attempting start
This commit is contained in:
commit
808b4cff6d
|
@ -339,10 +339,18 @@ func (d *Driver) Create() error {
|
|||
}
|
||||
|
||||
func (d *Driver) Start() error {
|
||||
if err := vbm("startvm", d.MachineName, "--type", "headless"); err != nil {
|
||||
s, err := d.GetState()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
log.Infof("Waiting for VM to start...")
|
||||
|
||||
if s == state.Stopped {
|
||||
if err := vbm("startvm", d.MachineName, "--type", "headless"); err != nil {
|
||||
return err
|
||||
}
|
||||
log.Infof("Waiting for VM to start...")
|
||||
}
|
||||
|
||||
return ssh.WaitForTCP(fmt.Sprintf("localhost:%d", d.SSHPort))
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue