From 34b6468c2c22a7a144ef5ce9f966c3acba0cf1a5 Mon Sep 17 00:00:00 2001 From: David Gageot Date: Mon, 21 Dec 2015 09:47:54 +0100 Subject: [PATCH] FIX #2370 add feedback to the user Signed-off-by: David Gageot --- libmachine/host/host.go | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/libmachine/host/host.go b/libmachine/host/host.go index 9298c28034..7179819c77 100644 --- a/libmachine/host/host.go +++ b/libmachine/host/host.go @@ -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 {