Skip to content

Commit

Permalink
Merge pull request #175 from sijeesh/exec_timeout_fix
Browse files Browse the repository at this point in the history
ExecCommandOutputWithTimeout-timeout parameter fix
  • Loading branch information
sijeesh committed Feb 24, 2023
2 parents b57bfd5 + c5ed87c commit 8b8d701
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions util/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 8b8d701

Please sign in to comment.