Skip to content

Commit

Permalink
Fix bug in pbs path resolution
Browse files Browse the repository at this point in the history
  • Loading branch information
dougnd committed Jul 25, 2024
1 parent 5f3c503 commit 0a580fe
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pbs/pbs.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"log/slog"
"os"
"os/exec"
"path"
"strings"

"github.com/clemsonciti/jobperf"
Expand All @@ -29,12 +30,13 @@ type jobEngine struct {
}

func NewJobEngine() jobperf.JobEngine {
var err error
var engine jobEngine
engine.pbsBinPath, err = exec.LookPath("qstat")
qstatPath, err := exec.LookPath("qstat")
if err != nil {
slog.Error("failed to find pbs binary path. Defaulting to /opt/pbs/default/bin", "err", err)
engine.pbsBinPath = "/opt/pbs/default/bin"
} else {
engine.pbsBinPath = path.Dir(qstatPath)
}
return engine
}
Expand Down

0 comments on commit 0a580fe

Please sign in to comment.