summaryrefslogtreecommitdiffstats
path: root/lib/facter/physicalprocessorcount.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/facter/physicalprocessorcount.rb')
-rw-r--r--lib/facter/physicalprocessorcount.rb7
1 files changed, 2 insertions, 5 deletions
diff --git a/lib/facter/physicalprocessorcount.rb b/lib/facter/physicalprocessorcount.rb
index c6145dc..22c00c1 100644
--- a/lib/facter/physicalprocessorcount.rb
+++ b/lib/facter/physicalprocessorcount.rb
@@ -39,10 +39,7 @@ Facter.add('physicalprocessorcount') do
lookup_pattern = "#{sysfs_cpu_directory}" +
"/cpu*/topology/physical_package_id"
- ids = Dir.glob(lookup_pattern).collect { |f| Facter::Util::Resolution.exec("cat #{f}")}
-
- ids = ids.join if ids.is_a?(Array)
- ids.scan(/\d+/).uniq.size
+ Dir.glob(lookup_pattern).collect { |f| Facter::Util::Resolution.exec("cat #{f}")}.uniq.size
else
#
@@ -53,7 +50,7 @@ Facter.add('physicalprocessorcount') do
#
str = Facter::Util::Resolution.exec("grep 'physical.\\+:' /proc/cpuinfo")
- if not str.nil? then str.scan(/\d+/).uniq.size; end
+ if str then str.scan(/\d+/).uniq.size; end
end
end
end