Sha256: 9f150c9d8d24d2e0cf8854afc05eb09698c75775b3ec6e6e6ed5422f41fe7206
Contents?: true
Size: 1.66 KB
Versions: 1
Compression:
Stored size: 1.66 KB
Contents
require "timeout" require "log4r" require "vagrant/util/retryable" require "vagrant/util/silence_warnings" Vagrant::Util::SilenceWarnings.silence! do require "winrm-s" end require "vagrant/../../plugins/communicators/winrm/file_manager" require "vagrant/../../plugins/communicators/winrm/shell" module VagrantPlugins module CommunicatorWinRM class WinRMSShell < WinRMShell include Vagrant::Util::Retryable attr_reader :transport attr_reader :protocol def initialize(host, username, password, options = {}) super(host, username, password, options) @logger = Log4r::Logger.new("vagrant::communication::winrmsshell") @transport = options[:transport] || :plaintext @protocol = (options[:transport] == :ssl) ? "https" : "http" end protected def new_session @logger.info("Attempting to connect to WinRM...") @logger.info(" - Host: #{@host}") @logger.info(" - Port: #{@port}") @logger.info(" - Username: #{@username}") @logger.info(" - Transport: #{@transport}") @logger.info(" - Endpoint: #{endpoint}") client = ::WinRM::WinRMWebService.new(endpoint, @transport, endpoint_options) client.set_timeout(@timeout_in_seconds) client.toggle_nori_type_casting(:off) client end def endpoint "#{@protocol}://#{@host}:#{@port}/wsman" end def endpoint_options { user: @username, pass: @password, host: @host, port: @port, operation_timeout: @timeout_in_seconds, basic_auth_only: (@transport == :plaintext) } end end # WinShell class end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
vagrant-winrm-s-0.0.3 | lib/vagrant-winrm-s/shell.rb |