Sha256: fbf504a458ef339810ebe63f07880e3d726af9cad5b3ce28c86ad842fb4498ae

Contents?: true

Size: 1.41 KB

Versions: 19

Compression:

Stored size: 1.41 KB

Contents

module VagrantPlugins
  module ProviderVirtualBox
    module Action
      class CheckGuestAdditions
        def initialize(app, env)
          @app = app
        end

        def call(env)
          # Use the raw interface for now, while the virtualbox gem
          # doesn't support guest properties (due to cross platform issues)
          version = env[:machine].provider.driver.read_guest_additions_version
          if !version
            env[:ui].warn I18n.t("vagrant.actions.vm.check_guest_additions.not_detected")
          else
            # Read the versions
            versions = [version, env[:machine].provider.driver.version]

            # Strip of any -OSE or _OSE and read only the first two parts
            # of the version such as "4.2" in "4.2.0"
            versions.map! do |v|
              v     = v.gsub(/[-_]ose/i, '')
              match = /^(\d+\.\d+)\.(\d+)/.match(v)
              v     = match[1] if match
              v
            end

            guest_version = versions[0]
            vb_version    = versions[1]

            if guest_version != vb_version
              env[:ui].warn(I18n.t("vagrant.actions.vm.check_guest_additions.version_mismatch",
                                   :guest_version => version,
                                   :virtualbox_version => vb_version))
            end
          end

          # Continue
          @app.call(env)
        end

      end
    end
  end
end

Version data entries

19 entries across 19 versions & 6 rubygems

Version Path
tamtam-vagrant-reload-1.1.3 vendor/cache/vagrant-0ac2a8738841/plugins/providers/virtualbox/action/check_guest_additions.rb
tamtam-vagrant-reload-1.1.2 vendor/cache/vagrant-0ac2a8738841/plugins/providers/virtualbox/action/check_guest_additions.rb
tamtam-vagrant-reload-1.1.1 vendor/cache/vagrant-0ac2a8738841/plugins/providers/virtualbox/action/check_guest_additions.rb
tamtam-vagrant-reload-1.1 vendor/cache/vagrant-0ac2a8738841/plugins/providers/virtualbox/action/check_guest_additions.rb
tnargav-1.3.6 plugins/providers/virtualbox/action/check_guest_additions.rb
tnargav-1.3.3 plugins/providers/virtualbox/action/check_guest_additions.rb
vagrant-shell-0.2.9 demo/templates/vendor/bundle/ruby/1.9.1/gems/tnargav-1.2.2/plugins/providers/virtualbox/action/check_guest_additions.rb
tnargav-1.2.3 plugins/providers/virtualbox/action/check_guest_additions.rb
vagrant-shell-0.2.8 demo/templates/vendor/bundle/ruby/1.9.1/gems/tnargav-1.2.2/plugins/providers/virtualbox/action/check_guest_additions.rb
vagrant-shell-0.2.6 vendor/bundle/gems/tnargav-1.2.2/plugins/providers/virtualbox/action/check_guest_additions.rb
vagrant-shell-0.2.5 vendor/bundle/gems/tnargav-1.2.2/plugins/providers/virtualbox/action/check_guest_additions.rb
tnargav-1.2.2 plugins/providers/virtualbox/action/check_guest_additions.rb
vagrantup-1.1.3 plugins/providers/virtualbox/action/check_guest_additions.rb
vagrantup-1.1.2 plugins/providers/virtualbox/action/check_guest_additions.rb
vagrantup-1.1.1 plugins/providers/virtualbox/action/check_guest_additions.rb
vagrantup-1.1.0 plugins/providers/virtualbox/action/check_guest_additions.rb
vagrantup-1.1.4 plugins/providers/virtualbox/action/check_guest_additions.rb
vagrant-actionio-0.0.9 vendor/bundle/bundler/gems/vagrant-c74251a1d9c0/plugins/providers/virtualbox/action/check_guest_additions.rb
vagrant-lxc-0.0.1 vendor/vagrant/plugins/providers/virtualbox/action/check_guest_additions.rb