From 8a3b3ed77f5c314a9b157bf456692b21e5637b29 Mon Sep 17 00:00:00 2001 From: jichenjc Date: Mon, 3 Jun 2019 03:23:24 +0000 Subject: [PATCH] downgrade log of util.ExecuteCommand 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. --- pkg/util/util.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pkg/util/util.go b/pkg/util/util.go index 519b2add7f0d..76af756efc23 100644 --- a/pkg/util/util.go +++ b/pkg/util/util.go @@ -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.