Skip to content

Commit

Permalink
downgrade log of util.ExecuteCommand
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 committed Jun 20, 2019
1 parent 30d2ec8 commit 8a3b3ed
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 8a3b3ed

Please sign in to comment.