From c5ed87cc61e0bec45a5f3ce3ce3d04aaca7141b7 Mon Sep 17 00:00:00 2001 From: sijeesh Date: Mon, 30 Jan 2023 12:22:51 +0530 Subject: [PATCH] ExecCommandOutputWithTimeout-timeout parameter fix Signed-off-by: sijeesh --- util/cmd.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/util/cmd.go b/util/cmd.go index 9a64eac..52ced4b 100644 --- a/util/cmd.go +++ b/util/cmd.go @@ -19,12 +19,13 @@ package util import ( "bytes" "fmt" - log "github.com/hpe-storage/common-host-libs/logger" "os/exec" "regexp" "strings" "syscall" "time" + + log "github.com/hpe-storage/common-host-libs/logger" ) const ( @@ -82,8 +83,9 @@ func execCommandOutputWithTimeout(cmd string, args []string, stdinArgs []string, // ExecCommandOutputWithTimeout executes ExecCommandOutput with the specified timeout func ExecCommandOutputWithTimeout(cmd string, args []string, timeout int) (string, int, error) { - return execCommandOutputWithTimeout(cmd, args, []string{}, defaultTimeout) + return execCommandOutputWithTimeout(cmd, args, []string{}, timeout) } + // ExecCommandOutput returns stdout and stderr in a single string, the return code, and error. // If the return code is not zero, error will not be nil. // Stdout and Stderr are dumped to the log at the debug level.