Re: exception in thread? in Net::SSH::Multi
- From: Sylvain Viart <sylvain@xxxxxxxxxxxxxxxxx>
- Date: Fri, 3 Oct 2008 02:39:55 -0500
Hi Brian,
Thanks a lot for your work, I really appreciate your effort. :-)
Brian Candler a écrit :
Sylvain Viart wrote:Sorry for that, I'm not enough backtrace friendly. :-\
Works, but I still don't know why the exception are not handled in the
lib Net::SSH::Multi which may be specific to this lib.
Show the backtrace! Otherwise, nobody is going to be able to help you.
----------------------------8<----------------------- t3.rb
require 'rubygems'
require 'net/ssh/multi'
Net::SSH::Multi.start(:on_error => :warn) do |session|
# define the servers we want to use
session.use 'root@srv-04'
session.use 'root@srv-07'
session.use 'root@srv-08'
session.use 'root@xxxxxxxxxxxxx'
# execute commands on all servers
session.exec( "hostname" )
# run the aggregated event loop
session.loop
end
----------------------------8<-----------------------
ruby t3.rb
error connecting to root@srv-04: Net::SSH::AuthenticationFailed
(root@srv-04)
Text will be echoed in the clear. Please install the HighLine or Termios
libraries to suppress echoed text.
Password:
/var/lib/gems/1.8/gems/net-ssh-2.0.4/lib/net/ssh/transport/session.rb:65:in
`initialize': No route to host - connect(2) (Errno::EHOSTUNREACH)
from
/var/lib/gems/1.8/gems/net-ssh-multi-1.0.0/lib/net/ssh/multi/session_actions.rb:37:in
`join'
from
/var/lib/gems/1.8/gems/net-ssh-multi-1.0.0/lib/net/ssh/multi/session_actions.rb:37:in
`sessions'
from
/var/lib/gems/1.8/gems/net-ssh-multi-1.0.0/lib/net/ssh/multi/session_actions.rb:37:in
`each'
from
/var/lib/gems/1.8/gems/net-ssh-multi-1.0.0/lib/net/ssh/multi/session_actions.rb:37:in
`sessions'
from
/var/lib/gems/1.8/gems/net-ssh-multi-1.0.0/lib/net/ssh/multi/session_actions.rb:81:in
`open_channel'
from
/var/lib/gems/1.8/gems/net-ssh-multi-1.0.0/lib/net/ssh/multi/session_actions.rb:120:in
`exec'
from t3.rb:12
from
/var/lib/gems/1.8/gems/net-ssh-multi-1.0.0/lib/net/ssh/multi.rb:62:in
`start'
from t3.rb:4
shell returned 1
I think you're right and this kind of exception is not handled by the lib.
I've to reread the lib, but its doc is confusing.
Regards,
Sylvain.
.
- Follow-Ups:
- Re: exception in thread? in Net::SSH::Multi
- From: Brian Candler
- Re: exception in thread? in Net::SSH::Multi
- Prev by Date: Re: How to do ruby setup on linux?
- Next by Date: Re: pathname's each_entry
- Previous by thread: [ANN] icanhasaudio 0.1.3 Released
- Next by thread: Re: exception in thread? in Net::SSH::Multi
- Index(es):
Relevant Pages
|