Sha256: b2f232a833a8c6bc26f4d39979e2cb298b20ecfb2df0d6a3046c50c96d401a92

Contents?: true

Size: 867 Bytes

Versions: 4

Compression:

Stored size: 867 Bytes

Contents

module VagrantPlugins
  module GuestRedHat
    module Cap
      class Flavor
        def self.flavor(machine)
          # Pick up version info from `/etc/os-release`. This file started to exist
          # in RHEL 7. For versions before that (i.e. RHEL 6) just plain `:rhel`
          # should do.
          version = nil
          if machine.communicate.test("test -f /etc/os-release")
            begin
              machine.communicate.execute("source /etc/os-release && printf $VERSION_ID") do |type, data|
                if type == :stdout
                  version = data.split(".").first.to_i
                end
              end
            rescue
            end
          end
          if version.nil? || version < 1
            return :rhel
          else
            return "rhel_#{version}".to_sym
          end
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
vagrant-unbundled-2.3.6.0 plugins/guests/redhat/cap/flavor.rb
tamtam-vagrant-reload-1.2.1 vendor/cache/vagrant-2092df529ae7/plugins/guests/redhat/cap/flavor.rb
vagrant-unbundled-2.3.3.0 plugins/guests/redhat/cap/flavor.rb
vagrant-unbundled-2.3.2.0 plugins/guests/redhat/cap/flavor.rb