mirror of https://github.com/docker/docs.git
FIX #2370 add feedback to the user
Signed-off-by: David Gageot <david@gageot.net>
This commit is contained in:
parent
c584b8e641
commit
34b6468c2c
|
@ -95,15 +95,30 @@ func (h *Host) runActionForState(action func() error, desiredState state.State)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (h *Host) Start() error {
|
func (h *Host) Start() error {
|
||||||
return h.runActionForState(h.Driver.Start, state.Running)
|
if err := h.runActionForState(h.Driver.Start, state.Running); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
log.Infof("Machine %q was started.", h.Name)
|
||||||
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (h *Host) Stop() error {
|
func (h *Host) Stop() error {
|
||||||
return h.runActionForState(h.Driver.Stop, state.Stopped)
|
if err := h.runActionForState(h.Driver.Stop, state.Stopped); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
log.Infof("Machine %q was stopped.", h.Name)
|
||||||
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (h *Host) Kill() error {
|
func (h *Host) Kill() error {
|
||||||
return h.runActionForState(h.Driver.Kill, state.Stopped)
|
if err := h.runActionForState(h.Driver.Kill, state.Stopped); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
log.Infof("Machine %q was killed.", h.Name)
|
||||||
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (h *Host) Restart() error {
|
func (h *Host) Restart() error {
|
||||||
|
|
Loading…
Reference in New Issue