diff options
Diffstat (limited to 'lib/net/ssh/multi/server.rb')
-rw-r--r-- | lib/net/ssh/multi/server.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/net/ssh/multi/server.rb b/lib/net/ssh/multi/server.rb index 999e788..3354b0a 100644 --- a/lib/net/ssh/multi/server.rb +++ b/lib/net/ssh/multi/server.rb @@ -36,6 +36,7 @@ module Net; module SSH; module Multi @user = user @options = options.dup @gateway = @options.delete(:via) + @failed = false end # Returns the value of the server property with the given +key+. Server @@ -82,6 +83,18 @@ module Net; module SSH; module Multi @inspect ||= "#<%s:0x%x %s>" % [self.class.name, object_id, to_s] end + # Returns +true+ if this server has ever failed a connection attempt. + def failed? + @failed + end + + # Indicates (by default) that this server has just failed a connection + # attempt. If +flag+ is false, this can be used to reset the failed flag + # so that a retry may be attempted. + def fail!(flag=true) + @failed = flag + end + # Returns the Net::SSH session object for this server. If +require_session+ # is false and the session has not previously been created, this will # return +nil+. If +require_session+ is true, the session will be instantiated |