From 773c525ae71c1852ac650b72543c8a695a1431d1 Mon Sep 17 00:00:00 2001 From: Medya Gh Date: Tue, 29 Oct 2019 16:36:10 -0700 Subject: [PATCH] fix test and remove extra code --- pkg/drivers/none/none.go | 6 +----- pkg/minikube/command/exec_runner.go | 2 +- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/pkg/drivers/none/none.go b/pkg/drivers/none/none.go index 1e96cc6830b4..4d99fd8b8ed1 100644 --- a/pkg/drivers/none/none.go +++ b/pkg/drivers/none/none.go @@ -17,7 +17,6 @@ limitations under the License. package none import ( - "bytes" "fmt" "os/exec" "strings" @@ -225,16 +224,13 @@ func stopKubelet(cr command.Runner) error { if rr, err := cr.RunCmd(cmd); err != nil { glog.Errorf("temporary error for %q : %v", rr.Command(), err) } - var out bytes.Buffer cmd = exec.Command("sudo", "systemctl", "show", "-p", "SubState", "kubelet") - cmd.Stdout = &out - cmd.Stderr = &out rr, err := cr.RunCmd(cmd) if err != nil { glog.Errorf("temporary error: for %q : %v", rr.Command(), err) } if !strings.Contains(rr.Stdout.String(), "dead") && !strings.Contains(rr.Stdout.String(), "failed") { - return fmt.Errorf("unexpected kubelet state: %q", out) + return fmt.Errorf("unexpected kubelet state: %q", rr.Stdout.String()) } return nil } diff --git a/pkg/minikube/command/exec_runner.go b/pkg/minikube/command/exec_runner.go index 2e9b92e6809f..a10023b3a82e 100644 --- a/pkg/minikube/command/exec_runner.go +++ b/pkg/minikube/command/exec_runner.go @@ -72,7 +72,7 @@ func (*ExecRunner) RunCmd(cmd *exec.Cmd) (*RunResult, error) { rr.ExitCode = exitError.ExitCode() } glog.Infof("(ExecRunner) Non-zero exit: %v: %v (%s)\n%s", rr.Command(), err, elapsed, rr.Output()) - err = errors.Wrapf(err, "command failed: %s\nstdout: %s\nstderr: %s", cmd, rr.Stdout.String(), rr.Stderr.String()) + err = errors.Wrapf(err, "command failed: %s\nstdout: %s\nstderr: %s", rr.Command(), rr.Stdout.String(), rr.Stderr.String()) } return rr, err }