Skip to content

Commit

Permalink
Merge pull request #40 from cego/continue-on-missing-dataset
Browse files Browse the repository at this point in the history
Fixed HasZFSCommand exec logic
  • Loading branch information
moberghammer authored Oct 7, 2024
2 parents 6938805 + 8764040 commit dd5e351
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions zfs/ZfsExecutor.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package zfs

import (
"errors"
"fmt"
"os"
"os/exec"
Expand Down Expand Up @@ -33,9 +32,9 @@ func (z *executorImpl) HasZFSCommand() error {
if stat, err := os.Stat(z.zfsCommandName); err == nil {
// Is executable by others
if stat.Mode()&0001 != 0 {
return errors.New("ZFS command is not executable")
return nil
}
return nil
return fmt.Errorf("ZFS command %s is not executable", z.zfsCommandName)
}
return fmt.Errorf("ZFS command %s not found", z.zfsCommandName)
}
Expand Down

0 comments on commit dd5e351

Please sign in to comment.