Sha256: b43fd5a4611df19cf7c990ffb78ba82945a3aa27ed41a786372fe3cb890ac8a1

Contents?: true

Size: 1.35 KB

Versions: 10

Compression:

Stored size: 1.35 KB

Contents

require 'veewee/provider/core/provider'

module Veewee
  module Provider
    module Vmfusion
      class Provider < Veewee::Provider::Core::Provider

        #include ::Veewee::Provider::Vmfusion::ProviderCommand

        def check_requirements
          require 'fission'

          if
            ::Fission.config.attributes["vmrun_bin"].nil? ||
            !File.exists?(::Fission.config.attributes["vmrun_bin"])
          then
            raise Veewee::Error,"Could not find vmrun at standard locations. Probably you don't have Vmware fusion installed"
          end
          env.logger.info("Found fusion version: #{fusion_version}")
        end

        def fusion_version
          # We ask the system profiler for all installed software
          shell_results = shell_exec("system_profiler SPApplicationsDataType", :external_encoding => Encoding::UTF_8)

          env.logger.info("Checking version by querying the system_profiler")
          env.logger.debug(shell_results.stdout)

          if shell_results.stdout == ""
            ui.warn "Could not detect the exact version of vmware. assuming 5.1"
            version = "5.1"
          else
            version = shell_results.stdout.split(/VMware/)[1].split(/\n/)[2].split(/:/)[1].strip
          end

          return version
        end

      end #End Class
    end # End Module
  end # End Module
end # End Module

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
veewee-0.5.0.alpha4 lib/veewee/provider/vmfusion/provider.rb
veewee-0.5.0.alpha3 lib/veewee/provider/vmfusion/provider.rb
veewee-0.5.0.alpha2 lib/veewee/provider/vmfusion/provider.rb
veewee-0.5.0.alpha1 lib/veewee/provider/vmfusion/provider.rb
veewee-0.4.5.1 lib/veewee/provider/vmfusion/provider.rb
veewee-0.4.5 lib/veewee/provider/vmfusion/provider.rb
veewee-0.4.5.pre1 lib/veewee/provider/vmfusion/provider.rb
veewee-0.4.4 lib/veewee/provider/vmfusion/provider.rb
veewee-0.4.3 lib/veewee/provider/vmfusion/provider.rb
veewee-0.4.2 lib/veewee/provider/vmfusion/provider.rb