Class: Kitchen::Transport::SshTgz

Inherits:
Ssh
  • Object
show all
Defined in:
lib/kitchen/transport/ssh_tgz.rb

Overview

A Transport which uses the SSH protocol to execute commands and transfer files. In addition, files are tar-gzipped to improve performance over high-latency network links.

Most of this class reuses functionality from the base Ssh class.

Author:

Defined Under Namespace

Classes: Connection

Instance Method Summary collapse

Instance Method Details

#create_new_connection(options, &block) ⇒ Object



144
145
146
147
148
149
150
151
152
# File 'lib/kitchen/transport/ssh_tgz.rb', line 144

def create_new_connection(options, &block)
  if @connection
    logger.debug("[SSH] shutting previous connection #{@connection}")
    @connection.close
  end

  @connection_options = options
  @connection = Kitchen::Transport::SshTgz::Connection.new(options, &block)
end

#finalize_config!(instance) ⇒ Object



44
45
46
47
48
49
50
51
52
# File 'lib/kitchen/transport/ssh_tgz.rb', line 44

def finalize_config!(instance)
  super.tap do
    if defined?(Kitchen::Verifier::Inspec) && instance.verifier.is_a?(Kitchen::Verifier::Inspec)
      instance.verifier.send(:define_singleton_method, :runner_options_for_sshtgz) do |config_data|
        runner_options_for_ssh(config_data)
      end
    end
  end
end