lib/ztk/ssh.rb in ztk-1.4.2 vs lib/ztk/ssh.rb in ztk-1.4.3

- old
+ new

@@ -183,9 +183,16 @@ def close config.ui.logger.debug { "close" } ssh and !ssh.closed? and ssh.close end + # The on_retry method we'll use with the RescueRetry class. + def on_retry(exception) + close + @ssh = nil + @sftp = nil + end + # Launches an SSH console, replacing the current process with the console # process. # # @example Launch a console: # ssh = ZTK::SSH.new