Skip to content

Commit

Permalink
downgrade log of util.ExecuteCommand (kubernetes-sigs#975)
Browse files Browse the repository at this point in the history
As this error E0531 is not that ueful and no need to be mark
this as 'E', use Info level should be fine as this won't affect
return value.
  • Loading branch information
jichenjc authored and k8s-ci-robot committed Jun 20, 2019
1 parent c2faf86 commit 97f25c9
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions pkg/util/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,13 +161,14 @@ func Copy(m *clusterv1.Machine) *clusterv1.Machine {
}

// ExecCommand Executes a local command in the current shell.
func ExecCommand(name string, args ...string) string {
func ExecCommand(name string, args ...string) (string, error) {
cmdOut, err := exec.Command(name, args...).Output()
if err != nil {
s := strings.Join(append([]string{name}, args...), " ")
klog.Errorf("error executing command %q: %v", s, err)
klog.Infof("Executing command %q: %v", s, err)
return string(""), err
}
return string(cmdOut)
return string(cmdOut), nil
}

// Filter filters a list for a string.
Expand Down

0 comments on commit 97f25c9

Please sign in to comment.