mirror of https://github.com/docker/docs.git
Merge pull request #815 from ehazlett/vbox-restart-stopped
vbox: fix issue where could not restart a stopped instance
This commit is contained in:
commit
7a336225e1
12
host.go
12
host.go
|
|
@ -643,12 +643,14 @@ func (h *Host) Kill() error {
|
|||
}
|
||||
|
||||
func (h *Host) Restart() error {
|
||||
if err := h.Stop(); err != nil {
|
||||
return err
|
||||
}
|
||||
if h.MachineInState(state.Running)() {
|
||||
if err := h.Stop(); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := utils.WaitFor(h.MachineInState(state.Stopped)); err != nil {
|
||||
return err
|
||||
if err := utils.WaitFor(h.MachineInState(state.Stopped)); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
if err := h.Start(); err != nil {
|
||||
|
|
|
|||
Loading…
Reference in New Issue