Codebase list facter / 5b10173
(#5135) Fix faulty logic in physicalprocessorcount - Was doing unnessary string manipulation when all that needed to be done was a uniq'd array. - Removed some backwards way of nil checking. Adrien Thebo authored 13 years ago James Turnbull committed 13 years ago
1 changed file(s) with 2 addition(s) and 5 deletion(s). Raw diff Collapse all Expand all
3838 lookup_pattern = "#{sysfs_cpu_directory}" +
3939 "/cpu*/topology/physical_package_id"
4040
41 ids = Dir.glob(lookup_pattern).collect { |f| Facter::Util::Resolution.exec("cat #{f}")}
42
43 ids = ids.join if ids.is_a?(Array)
44 ids.scan(/\d+/).uniq.size
41 Dir.glob(lookup_pattern).collect { |f| Facter::Util::Resolution.exec("cat #{f}")}.uniq.size
4542
4643 else
4744 #
5249 #
5350 str = Facter::Util::Resolution.exec("grep 'physical.\\+:' /proc/cpuinfo")
5451
55 if not str.nil? then str.scan(/\d+/).uniq.size; end
52 if str then str.scan(/\d+/).uniq.size; end
5653 end
5754 end
5855 end