Class: Facter::Operatingsystem::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/facter/operatingsystem/base.rb

Direct Known Subclasses

Linux, SunOS, VMkernel, Windows

Instance Method Summary collapse

Instance Method Details

#get_operatingsystemObject



6
7
8
9
# File 'lib/facter/operatingsystem/base.rb', line 6

def get_operatingsystem
  @operatingsystem ||= Facter.value(:kernel)
  @operatingsystem
end

#get_operatingsystemmajorreleaseObject



20
21
22
23
24
25
26
# File 'lib/facter/operatingsystem/base.rb', line 20

def get_operatingsystemmajorrelease
  if operatingsystemrelease = get_operatingsystemrelease
    if (releasemajor = operatingsystemrelease.split(".")[0])
      releasemajor
    end
  end
end

#get_operatingsystemminorreleaseObject



28
29
30
31
32
33
34
35
36
37
38
# File 'lib/facter/operatingsystem/base.rb', line 28

def get_operatingsystemminorrelease
  if operatingsystemrelease = get_operatingsystemrelease
    if (releaseminor = operatingsystemrelease.split(".")[1])
      if releaseminor.include? "-"
        releaseminor.split("-")[0]
      else
        releaseminor
      end
    end
  end
end

#get_operatingsystemreleaseObject



15
16
17
18
# File 'lib/facter/operatingsystem/base.rb', line 15

def get_operatingsystemrelease
  @operatingsystemrelease = Facter.value(:kernelrelease)
  @operatingsystemrelease
end

#get_operatingsystemrelease_hashObject



40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# File 'lib/facter/operatingsystem/base.rb', line 40

def get_operatingsystemrelease_hash
  release_hash = {}
  if releasemajor = get_operatingsystemmajorrelease
    release_hash["major"] = releasemajor
  end

  if releaseminor = get_operatingsystemminorrelease
    release_hash["minor"] = releaseminor
  end

  if release = get_operatingsystemrelease
    release_hash["full"] = release
  end
  release_hash
end

#get_osfamilyObject



11
12
13
# File 'lib/facter/operatingsystem/base.rb', line 11

def get_osfamily
  Facter.value(:kernel)
end

#has_lsb?Boolean

Returns:

  • (Boolean)


56
57
58
# File 'lib/facter/operatingsystem/base.rb', line 56

def has_lsb?
  false
end