diff --git a/lib/vagrant/hosts/bsd.rb b/lib/vagrant/hosts/bsd.rb index 655cf237d..7d63c4b91 100644 --- a/lib/vagrant/hosts/bsd.rb +++ b/lib/vagrant/hosts/bsd.rb @@ -3,17 +3,11 @@ module Vagrant # Represents a BSD host, such as FreeBSD and Darwin (Mac OS X). class BSD < Base include Util + include Util::Retryable def nfs? - tries = 10 - begin + retryable(:tries => 10, :on => TypeError) do system("which nfsd > /dev/null 2>&1") - rescue TypeError - tries -= 1 - retry if tries > 0 - - # Hopefully this point isn't reached - raise end end diff --git a/lib/vagrant/hosts/linux.rb b/lib/vagrant/hosts/linux.rb index 816a63e20..1d9706f2d 100644 --- a/lib/vagrant/hosts/linux.rb +++ b/lib/vagrant/hosts/linux.rb @@ -3,18 +3,12 @@ module Vagrant # Represents a Linux based host, such as Ubuntu. class Linux < Base include Util + include Util::Retryable def nfs? - tries = 10 - begin + retryable(:tries => 10, :on => TypeError) do # Check procfs to see if NFSd is a supported filesystem system("cat /proc/filesystems | grep nfsd > /dev/null 2>&1") - rescue TypeError - tries -= 1 - retry if tries > 0 - - # Hopefully this point isn't reached - raise end end