Skip to content

Commit 2387782

Browse files
author
sersut
committed
Return false in busy? calls for servers that has failed to connect.
1 parent ed24d84 commit 2387782

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/net/ssh/multi/server.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,9 @@ def session(require_session=false)
140140

141141
# Returns +true+ if the session has been opened, and the session is currently
142142
# busy (as defined by Net::SSH::Connection::Session#busy?).
143+
# Also returns false if the server has failed to connect.
143144
def busy?(include_invisible=false)
144-
session && session.busy?(include_invisible)
145+
!failed? && session && session.busy?(include_invisible)
145146
end
146147

147148
# Closes this server's session. If the session has not yet been opened,
@@ -228,4 +229,4 @@ def postprocess(readers, writers) #:nodoc:
228229
session.postprocess(listeners & readers, listeners & writers)
229230
end
230231
end
231-
end; end; end
232+
end; end; end

0 commit comments

Comments
 (0)