Sha256: 6d7fb8b37d427a130259dac9bd4edc30fd3b58aa8e3d41c5a9efc07c4532a977

Contents?: true

Size: 919 Bytes

Versions: 24

Compression:

Stored size: 919 Bytes

Contents

require_relative '../../../helper'
require_relative '../../../communication/winrmcommunicator'

module Vagrant
  class Machine
    
    ssh_communicate = instance_method(:communicate)
    
    # This patch is needed until Vagrant supports a configurable communication channel
    define_method(:communicate) do
      unless @communicator
        if @config.vm.guest.eql? :windows
          @logger.info("guest is #{@config.vm.guest}, using WinRM for communication channel")
          @communicator = ::VagrantWindows::Communication::WinRMCommunicator.new(self)
        else
          @logger.info("guest is #{@config.vm.guest}, using SSH for communication channel")
          @communicator = ssh_communicate.bind(self).()
        end
      end
      @communicator
    end
    
    def winrm
      @winrm ||= WinRM.new(self)
    end

    def is_windows?
      return @config.vm.guest.eql? :windows
    end
    
  end
end

Version data entries

24 entries across 24 versions & 2 rubygems

Version Path
vagrant-windows-1.7.0.pre.2 lib/vagrant-windows/monkey_patches/lib/vagrant/machine.rb
vagrant-windows-1.7.0.pre.1 lib/vagrant-windows/monkey_patches/lib/vagrant/machine.rb
vagrant-windows-1.6.0 lib/vagrant-windows/monkey_patches/lib/vagrant/machine.rb
vagrant-plugin-dummy-0.0.7 windows/monkey_patches/lib/vagrant/machine.rb
vagrant-windows-1.6.0.pre.1 lib/vagrant-windows/monkey_patches/lib/vagrant/machine.rb
vagrant-plugin-dummy-0.0.6 windows/monkey_patches/lib/vagrant/machine.rb
vagrant-plugin-dummy-0.0.5 windows/monkey_patches/lib/vagrant/machine.rb
vagrant-windows-1.5.1 lib/vagrant-windows/monkey_patches/lib/vagrant/machine.rb
vagrant-windows-1.5.0 lib/vagrant-windows/monkey_patches/lib/vagrant/machine.rb
vagrant-windows-1.4.0 lib/vagrant-windows/monkey_patches/lib/vagrant/machine.rb
vagrant-windows-1.3.2 lib/vagrant-windows/monkey_patches/lib/vagrant/machine.rb
vagrant-windows-1.3.1 lib/vagrant-windows/monkey_patches/lib/vagrant/machine.rb
vagrant-windows-1.3.0 lib/vagrant-windows/monkey_patches/lib/vagrant/machine.rb
vagrant-windows-1.3.0.pre.3 lib/vagrant-windows/monkey_patches/lib/vagrant/machine.rb
vagrant-windows-1.3.0.pre.2 lib/vagrant-windows/monkey_patches/lib/vagrant/machine.rb
vagrant-windows-1.3.0.pre.1 lib/vagrant-windows/monkey_patches/lib/vagrant/machine.rb
vagrant-windows-1.2.3 lib/vagrant-windows/monkey_patches/lib/vagrant/machine.rb
vagrant-windows-1.2.2 lib/vagrant-windows/monkey_patches/lib/vagrant/machine.rb
vagrant-plugin-dummy-0.0.4 windows/monkey_patches/lib/vagrant/machine.rb
vagrant-plugin-dummy-0.0.3 windows/monkey_patches/lib/vagrant/machine.rb