Rescue TypeError when checking for NFS and return false [closes GH-109]
This commit is contained in:
parent
1bfb99d606
commit
7e9b75f939
|
@ -7,6 +7,8 @@ module Vagrant
|
||||||
def nfs?
|
def nfs?
|
||||||
system("which nfsd")
|
system("which nfsd")
|
||||||
$?.to_i == 0
|
$?.to_i == 0
|
||||||
|
rescue TypeError
|
||||||
|
false
|
||||||
end
|
end
|
||||||
|
|
||||||
def nfs_export(ip, folders)
|
def nfs_export(ip, folders)
|
||||||
|
|
|
@ -26,6 +26,11 @@ class BSDHostTest < Test::Unit::TestCase
|
||||||
|
|
||||||
assert !@instance.nfs?
|
assert !@instance.nfs?
|
||||||
end
|
end
|
||||||
|
|
||||||
|
should "not support NFS if an error is raised" do
|
||||||
|
@instance.expects(:system).raises(TypeError.new("foo"))
|
||||||
|
assert !@instance.nfs?
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
context "nfs export" do
|
context "nfs export" do
|
||||||
|
|
Loading…
Reference in New Issue