Get rid of redundant retries, switch to retryable

This commit is contained in:
Mitchell Hashimoto 2010-09-09 00:37:54 -07:00
parent ea35608f64
commit 6db1afff04
2 changed files with 4 additions and 16 deletions

View File

@ -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

View File

@ -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