Skip to content

Commit

Permalink
driver: pass the correct source to IsMounted()
Browse files Browse the repository at this point in the history
We shouldn't pass an empty source path to IsMounted. Also make sure it's
never empty.
  • Loading branch information
fatih committed Aug 3, 2018
1 parent 186f4cb commit b90d5af
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
8 changes: 8 additions & 0 deletions driver/mounter.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,14 @@ func (m *mounter) IsFormatted(source string) (bool, error) {
}

func (m *mounter) IsMounted(source, target string) (bool, error) {
if source == "" {
return false, errors.New("source is not specified for checking the mount")
}

if target == "" {
return false, errors.New("target is not specified for checking the mount")
}

findmntCmd := "findmnt"
_, err := exec.LookPath(findmntCmd)
if err != nil {
Expand Down
8 changes: 7 additions & 1 deletion driver/node.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit b90d5af

Please sign in to comment.