Get rid of redundant retries, switch to retryable
This commit is contained in:
parent
ea35608f64
commit
6db1afff04
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue