We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 9a60cd9 + fa7c622 commit b0f79fdCopy full SHA for b0f79fd
1 file changed
lib/facter/resolvers/solaris/processors.rb
@@ -26,7 +26,8 @@ def collect_kstat_info(fact_name)
26
def parse_output(output)
27
@fact_list[:logical_count] = output.scan(/module/).size
28
@fact_list[:physical_count] = output.scan(/chip_id .*/).uniq.size
29
- @fact_list[:speed] = output.scan(/current_clock_Hz .*/).first.gsub(/[a-zA-z\s]+/, '').to_i
+ # .scan(//current_clock_Hz\s+(\d+)/) returns [['123']] (or [['123'], ['456']] if there are more matches)
30
+ @fact_list[:speed] = output.scan(/current_clock_Hz\s+(\d+)/).first&.first&.to_i
31
@fact_list[:models] = output.scan(/brand .*/).map { |elem| elem.gsub(/brand(\s+)/, '') }
32
calculate_threads_cores(output)
33
end
0 commit comments