Skip to content

Commit be185f2

Browse files
jichenjcncdc
authored andcommitted
downgrade log of util.ExecuteCommand (kubernetes-sigs#975)
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. (cherry picked from commit 97f25c9)
1 parent 3b55158 commit be185f2

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

pkg/util/util.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,13 +161,14 @@ func Copy(m *clusterv1.Machine) *clusterv1.Machine {
161161
}
162162

163163
// ExecCommand Executes a local command in the current shell.
164-
func ExecCommand(name string, args ...string) string {
164+
func ExecCommand(name string, args ...string) (string, error) {
165165
cmdOut, err := exec.Command(name, args...).Output()
166166
if err != nil {
167167
s := strings.Join(append([]string{name}, args...), " ")
168-
klog.Errorf("error executing command %q: %v", s, err)
168+
klog.Infof("Executing command %q: %v", s, err)
169+
return string(""), err
169170
}
170-
return string(cmdOut)
171+
return string(cmdOut), nil
171172
}
172173

173174
// Filter filters a list for a string.

0 commit comments

Comments
 (0)