summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsersut <serdar@opscode.com>2013-06-13 13:58:13 -0700
committersersut <serdar@opscode.com>2013-06-13 14:35:42 -0700
commit2387782ecc49976e6794df6a07f98a4ba3a0e25f (patch)
treefa7a65fa3b76d0344aa977a051e1f600575b8fb5
parented24d841fb4471422b7776698af381aab6ea375c (diff)
downloadnet-ssh-multi-2387782ecc49976e6794df6a07f98a4ba3a0e25f.tar.gz
Return false in busy? calls for servers that has failed to connect.
-rw-r--r--lib/net/ssh/multi/server.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/net/ssh/multi/server.rb b/lib/net/ssh/multi/server.rb
index bce228f..f8fa552 100644
--- a/lib/net/ssh/multi/server.rb
+++ b/lib/net/ssh/multi/server.rb
@@ -140,8 +140,9 @@ module Net; module SSH; module Multi
# Returns +true+ if the session has been opened, and the session is currently
# busy (as defined by Net::SSH::Connection::Session#busy?).
+ # Also returns false if the server has failed to connect.
def busy?(include_invisible=false)
- session && session.busy?(include_invisible)
+ !failed? && session && session.busy?(include_invisible)
end
# Closes this server's session. If the session has not yet been opened,
@@ -228,4 +229,4 @@ module Net; module SSH; module Multi
session.postprocess(listeners & readers, listeners & writers)
end
end
-end; end; end \ No newline at end of file
+end; end; end