Sha256: 156b6dad74ed5232f8005ca443c8d2eea0867401d781b04dc3c5f52e3b8abebf

Contents?: true

Size: 799 Bytes

Versions: 7

Compression:

Stored size: 799 Bytes

Contents

require_relative '../../../communication/communicator'

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? :dummy
          @logger.info("guest is #{@config.vm.guest}, using no communication channel")
          @communicator = ::VagrantPluginDummy::Communication::DummyCommunicator.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 is_dummy?
      return @config.vm.guest.eql? :dummy
    end

  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
vagrant-plugin-dummy-0.0.7 lib/vagrant-plugin-dummy/monkey_patches/lib/vagrant/machine.rb
vagrant-plugin-dummy-0.0.6 lib/vagrant-plugin-dummy/monkey_patches/lib/vagrant/machine.rb
vagrant-plugin-dummy-0.0.5 lib/vagrant-plugin-dummy/monkey_patches/lib/vagrant/machine.rb
vagrant-plugin-dummy-0.0.4 lib/vagrant-plugin-dummy/monkey_patches/lib/vagrant/machine.rb
vagrant-plugin-dummy-0.0.3 lib/vagrant-plugin-dummy/monkey_patches/lib/vagrant/machine.rb
vagrant-plugin-dummy-0.0.1 lib/vagrant-plugin-dummy/monkey_patches/lib/vagrant/machine.rb
vagrant-plugin-dummy-0.0.2 lib/vagrant-plugin-dummy/monkey_patches/lib/vagrant/machine.rb