From 97f25c964841e989ed61d05aaf214504c7cc3ae0 Mon Sep 17 00:00:00 2001 From: ji chen Date: Thu, 20 Jun 2019 22:46:52 +0800 Subject: [PATCH] downgrade log of util.ExecuteCommand (#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. --- 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.