Class: Kitchen::Transport::Rsync

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

Defined Under Namespace

Classes: Connection

Instance Method Summary collapse

Instance Method Details

#create_new_connection(options, &block) ⇒ Object

Copy-pasta from Ssh#create_new_connection because I need the Rsync connection class. Tracked in github.com/test-kitchen/test-kitchen/pull/726



40
41
42
43
44
45
46
47
48
# File 'lib/kitchen/transport/rsync.rb', line 40

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

  @connection_options = options
  @connection = self.class::Connection.new(options, &block)
end

#finalize_config!(instance) ⇒ Object



27
28
29
30
31
32
33
34
35
# File 'lib/kitchen/transport/rsync.rb', line 27

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_rsync) do |config_data|
        runner_options_for_ssh(config_data)
      end
    end
  end
end