Skip to content

Commit

Permalink
try not without checking stat first
Browse files Browse the repository at this point in the history
  • Loading branch information
Mahmood Ali committed Apr 2, 2019
1 parent 9adab75 commit d441cdd
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions drivers/shared/executor/executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -549,12 +549,6 @@ func (e *UniversalExecutor) handleStats(ch chan *cstructs.TaskResourceUsage, ctx
// the following locations, in-order: task/local/, task/, based on host $PATH.
// The return path is absolute.
func lookupBin(taskDir string, bin string) (string, error) {
// Check the binary path first
// This handles the case where the job spec sends a fully interpolated path to the binary
if _, err := os.Stat(bin); err == nil {
return bin, nil
}

// Check in the local directory
local := filepath.Join(taskDir, allocdir.TaskLocal, bin)
if _, err := os.Stat(local); err == nil {
Expand Down

0 comments on commit d441cdd

Please sign in to comment.