Merge pull request #2645 from dgageot/2370-add-feedback

FIX #2370 add feedback to the user
This commit is contained in:
Jean-Laurent de Morlhon 2015-12-21 17:08:07 +01:00
commit 6e8aaa0d56
1 changed files with 18 additions and 3 deletions

View File

@ -95,15 +95,30 @@ func (h *Host) runActionForState(action func() error, desiredState state.State)
}
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 {
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 {
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 {