Sha256: 66ff15aef064cdca50400c9c7ca62844017869b673bc0caa02dac99d09e21012

Contents?: true

Size: 899 Bytes

Versions: 25

Compression:

Stored size: 899 Bytes

Contents

module VagrantPlugins
  module Parallels
    module Action
      class CheckSharedInterface
        def initialize(app, env)
          @app = app
        end

        def call(env)
          shared_iface = env[:machine].provider.driver.read_shared_interface

          # Shared interface is connected. Just exit
          return @app.call(env) if shared_iface[:status] == 'Up'

          # Since PD 11.2.1 Vagrant can fix this automatically
          if !env[:machine].provider.pd_version_satisfies?('>= 11.2.1')
            raise Errors::SharedInterfaceDisconnected
          end

          env[:ui].info I18n.t('vagrant_parallels.actions.vm.check_shared_interface.connecting')
          iface_name = env[:machine].provider.driver.read_shared_network_id
          env[:machine].provider.driver.connect_network_interface(iface_name)

          @app.call(env)
        end
      end
    end
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
vagrant-parallels-2.4.2 lib/vagrant-parallels/action/check_shared_interface.rb
vagrant-parallels-2.4.1 lib/vagrant-parallels/action/check_shared_interface.rb
vagrant-parallels-2.4.0 lib/vagrant-parallels/action/check_shared_interface.rb
vagrant-parallels-2.3.1 lib/vagrant-parallels/action/check_shared_interface.rb
vagrant-parallels-2.3.0 lib/vagrant-parallels/action/check_shared_interface.rb
vagrant-parallels-2.2.6 lib/vagrant-parallels/action/check_shared_interface.rb
vagrant-parallels-2.2.5 lib/vagrant-parallels/action/check_shared_interface.rb
vagrant-parallels-2.2.4 lib/vagrant-parallels/action/check_shared_interface.rb
vagrant-parallels-2.2.3 lib/vagrant-parallels/action/check_shared_interface.rb
vagrant-parallels-2.2.2 lib/vagrant-parallels/action/check_shared_interface.rb
vagrant-parallels-2.2.1 lib/vagrant-parallels/action/check_shared_interface.rb
vagrant-parallels-2.2.0 lib/vagrant-parallels/action/check_shared_interface.rb
vagrant-parallels-2.1.0 lib/vagrant-parallels/action/check_shared_interface.rb
vagrant-parallels-2.0.1 lib/vagrant-parallels/action/check_shared_interface.rb
vagrant-parallels-2.0.0 lib/vagrant-parallels/action/check_shared_interface.rb
vagrant-parallels-1.7.8 lib/vagrant-parallels/action/check_shared_interface.rb
vagrant-parallels-1.7.7 lib/vagrant-parallels/action/check_shared_interface.rb
vagrant-parallels-1.7.6 lib/vagrant-parallels/action/check_shared_interface.rb
vagrant-parallels-1.7.5 lib/vagrant-parallels/action/check_shared_interface.rb
vagrant-parallels-1.7.4 lib/vagrant-parallels/action/check_shared_interface.rb