]> gitweb.fluxo.info Git - leap/leap_cli.git/commitdiff
properly debug Net::SSH based on -v log level
authorelijah <elijah@riseup.net>
Wed, 29 Oct 2014 06:37:59 +0000 (23:37 -0700)
committerelijah <elijah@riseup.net>
Wed, 29 Oct 2014 06:37:59 +0000 (23:37 -0700)
lib/leap_cli/util/remote_command.rb

index 6b4d75fd4f409a3ea2a7fca4de1cc51a17fc4710..f4725de2ff8f5ace698b0d77db73ec937c0da0c3 100644 (file)
@@ -78,10 +78,20 @@ module LeapCli; module Util; module RemoteCommand
       :keys_only => false, # Don't you dare change this.
       :global_known_hosts_file => path(:known_hosts),
       :user_known_hosts_file => '/dev/null',
-      :paranoid => true
+      :paranoid => true,
+      :verbose => net_ssh_log_level
     }
   end
 
+  def net_ssh_log_level
+    case LeapCli.log_level
+      when 0 then 3
+      when 1 then 2
+      when 2 then 1
+      else 0
+    end
+  end
+
   #
   # For notes on advanced ways to set server-specific options, see
   # http://railsware.com/blog/2011/11/02/advanced-server-definitions-in-capistrano/