From: Sylvain Viart Date: 2008-10-03T16:39:55+09:00 Subject: Re: exception in thread? in Net::SSH::Multi Hi Brian, Thanks a lot for your work, I really appreciate your effort. :-) Brian Candler a écrit : > Sylvain Viart wrote: > >> 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. > Sorry for that, I'm not enough backtrace friendly. :-\ ----------------------------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@fail-08.local' # 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.