Skip to content

Commit

Permalink
fix test and remove extra code
Browse files Browse the repository at this point in the history
  • Loading branch information
medyagh committed Oct 29, 2019
1 parent cd9e413 commit 773c525
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
6 changes: 1 addition & 5 deletions pkg/drivers/none/none.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ limitations under the License.
package none

import (
"bytes"
"fmt"
"os/exec"
"strings"
Expand Down Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/minikube/command/exec_runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 773c525

Please sign in to comment.