Class: Facter::Processors::SunOS

Inherits:
Base
  • Object
show all
Defined in:
lib/facter/processors/os.rb

Instance Method Summary collapse

Methods inherited from Base

#get_processor_speed

Constructor Details

#initializeSunOS

Returns a new instance of SunOS.



193
194
195
196
197
# File 'lib/facter/processors/os.rb', line 193

def initialize
  kernelrelease = Facter.value(:kernelrelease)
  @major_version = kernelrelease.split(".")[0].to_i
  @minor_version = kernelrelease.split(".")[1].to_i
end

Instance Method Details

#get_physical_processor_countObject



215
216
217
218
219
220
221
222
223
# File 'lib/facter/processors/os.rb', line 215

def get_physical_processor_count
  if @major_version > 5 or (@major_version == 5 and @minor_version >= 8)
    if output = Facter::Core::Execution.exec("/usr/sbin/psrinfo -p")
      output.to_i
    end
  else
    count_cpu_with_psrinfo
  end
end

#get_processor_countObject



203
204
205
206
207
208
209
210
211
212
213
# File 'lib/facter/processors/os.rb', line 203

def get_processor_count
  if @major_version < 5 or (@major_version == 5 and @minor_version < 8)
    if count = count_cpu_with_kstat
      count
    else
      count_cpu_with_psrinfo
    end
  else
    count_cpu_with_psrinfo
  end
end

#get_processor_listObject



199
200
201
# File 'lib/facter/processors/os.rb', line 199

def get_processor_list
  Facter::Util::Processor.enum_kstat
end