Parent

Class/Module Index [+]

Quicksearch

Facter::Operatingsystem::SunOS

Public Instance Methods

get_operatingsystem() click to toggle source
# File lib/facter/operatingsystem/sunos.rb, line 7
def get_operatingsystem
  output = Facter::Core::Execution.exec('uname -v')
  if output =~ /^joyent_/
    "SmartOS"
  elsif output =~ /^oi_/
    "OpenIndiana"
  elsif output =~ /^omnios-/
    "OmniOS"
  elsif FileTest.exists?("/etc/debian_version")
    "Nexenta"
  else
    "Solaris"
  end
end
get_operatingsystemmajorrelease() click to toggle source
# File lib/facter/operatingsystem/sunos.rb, line 45
def get_operatingsystemmajorrelease
  if get_operatingsystem == "Solaris"
    if match = get_operatingsystemrelease.match(/^(\d+)/)
      match.captures[0]
    end
  end
end
get_operatingsystemrelease() click to toggle source
# File lib/facter/operatingsystem/sunos.rb, line 26
def get_operatingsystemrelease
  if release = Facter::Util::FileRead.read('/etc/release')
    line = release.split("\n").first

    # Solaris 10: Solaris 10 10/09 s10x_u8wos_08a X86
    # Solaris 11 (old naming scheme): Oracle Solaris 11 11/11 X86
    # Solaris 11 (new naming scheme): Oracle Solaris 11.1 SPARC
    if match = /\s+s(\d+)[sx]?(_u\d+)?.*(?:SPARC|X86)/.match(line)
      match.captures.join('')
    elsif match = /Solaris ([0-9\.]+(?:\s*[0-9\.\/]+))\s*(?:SPARC|X86)/.match(line)
      match.captures[0]
    else
      Facter[:kernelrelease].value
    end
  else
    Facter[:kernelrelease].value
  end
end
get_osfamily() click to toggle source
# File lib/facter/operatingsystem/sunos.rb, line 22
def get_osfamily
  "Solaris"
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.