mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-11-27 08:40:23 +00:00
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 <yuggupta27@gmail.com> Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
This commit is contained in:
parent
e99b996bea
commit
eaf0058c31
@ -48,7 +48,7 @@ func ExecCommand(ctx context.Context, program string, args ...string) (string, s
|
|||||||
stderr := stderrBuf.String()
|
stderr := stderrBuf.String()
|
||||||
|
|
||||||
if err != nil {
|
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() {
|
if ctx != context.TODO() {
|
||||||
UsefulLog(ctx, "%s", err)
|
UsefulLog(ctx, "%s", err)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user