From eaf0058c31a885838069155fba929b1a29eeece7 Mon Sep 17 00:00:00 2001 From: Madhu Rajanna Date: Fri, 6 Nov 2020 08:00:46 +0530 Subject: [PATCH] util: log stderror in ExecCommand all the CLI commands we execute logs the actual error in stdError. logging stderror is using for debugging. Co-authored-by: Yug Signed-off-by: Madhu Rajanna --- internal/util/cephcmds.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/util/cephcmds.go b/internal/util/cephcmds.go index adc95ffb7..8bb55e6db 100644 --- a/internal/util/cephcmds.go +++ b/internal/util/cephcmds.go @@ -48,7 +48,7 @@ func ExecCommand(ctx context.Context, program string, args ...string) (string, s stderr := stderrBuf.String() if err != nil { - err = fmt.Errorf("an error (%w) occurred while running %s args: %v", err, program, sanitizedArgs) + err = fmt.Errorf("an error (%w) and stdError (%s) occurred while running %s args: %v", err, stderr, program, sanitizedArgs) if ctx != context.TODO() { UsefulLog(ctx, "%s", err) }