Class: Kitchen::Transport::Winrm

Inherits:
Base show all
Defined in:
lib/kitchen/transport/winrm.rb

Overview

A Transport which uses WinRM to execute commands and transfer files.

Author:

Defined Under Namespace

Classes: Connection

Instance Attribute Summary

Attributes included from Configurable

#instance

Instance Method Summary collapse

Methods inherited from Base

#cleanup!, #doctor, #initialize, kitchen_transport_api_version

Methods included from Logging

#banner, #debug, #error, #fatal, #info, #warn

Methods included from Configurable

#[], #bourne_shell?, #calculate_path, #config_keys, #diagnose, #diagnose_plugin, included, #name, #powershell_shell?, #remote_path_join, #unix_os?, #verify_dependencies, #windows_os?

Methods inherited from Plugin::Base

no_parallel_for

Constructor Details

This class inherits a constructor from Kitchen::Transport::Base

Instance Method Details

#connection(state, &block) ⇒ Connection

Creates a new Connection, configured by a merging of configuration and state data. Depending on the implementation, the Connection could be saved or cached to speed up multiple calls, given the same state hash as input.

rubocop:disable Lint/UnusedMethodArgument

Parameters:

  • state (Hash)

    mutable instance state

Returns:

  • (Connection)

    a connection for this transport

Raises:



70
71
72
73
74
75
76
77
78
# File 'lib/kitchen/transport/winrm.rb', line 70

def connection(state, &block)
  options = connection_options(config.to_hash.merge(state))

  if @connection && @connection_options == options
    reuse_connection(&block)
  else
    create_new_connection(options, &block)
  end
end

#finalize_config!(instance) ⇒ Object



61
62
63
64
65
66
67
# File 'lib/kitchen/transport/winrm.rb', line 61

def finalize_config!(instance)
  super

  config[:winrm_transport] = config[:winrm_transport].to_sym

  self
end