Skip to content
This repository has been archived by the owner on Aug 29, 2018. It is now read-only.

Commit

Permalink
Color error message from SSH
Browse files Browse the repository at this point in the history
  • Loading branch information
smarterclayton committed Oct 29, 2013
1 parent e296cb9 commit 4c2281d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/rhc/ssh_helpers.rb
Expand Up @@ -35,7 +35,7 @@ def run(&block)

Net::SSH::Multi.start(
:concurrent_connections => @opts[:limit],
:on_error => lambda{ |server| $stderr.puts "Unable to connect to gear #{server}" }
:on_error => lambda{ |server| $stderr.puts RHC::Helpers.color("Unable to connect to gear #{server}", :red) }
) do |session|

@over.each do |item|
Expand Down
2 changes: 1 addition & 1 deletion spec/spec_helper.rb
Expand Up @@ -420,7 +420,7 @@ def exec(arg1, *args, &block)
session.should_receive(:loop) unless hosts.empty?
Net::SSH::Multi.should_receive(:start).and_yield(session).with do |opts|
opts.should have_key(:on_error)
capture_all{ opts[:on_error].call('test') }.should == "Unable to connect to gear test\n" if check_error
capture_all{ opts[:on_error].call('test') }.should =~ /Unable to connect to gear test/ if check_error
true
end
session
Expand Down

0 comments on commit 4c2281d

Please sign in to comment.