Make the 'processor' fact consistent with other operating systems.

This commit is contained in:
jasper 2014-05-02 18:36:55 +00:00
parent c09bc495b5
commit c41fd16fbd
2 changed files with 40 additions and 2 deletions

View File

@ -1,9 +1,9 @@
# $OpenBSD: Makefile,v 1.54 2014/04/17 18:12:09 jasper Exp $
# $OpenBSD: Makefile,v 1.55 2014/05/02 18:36:55 jasper Exp $
COMMENT= Ruby library for retrieving facts from operating systems
VERSION= 2.0.1
REVISION= 0
REVISION= 1
DISTNAME= facter-${VERSION}
CATEGORIES= sysutils

View File

@ -0,0 +1,38 @@
$OpenBSD: patch-lib_facter_processor_rb,v 1.1 2014/05/02 18:36:55 jasper Exp $
Make the 'processor' fact consistent with other operating systems.
--- lib/facter/processor.rb.orig Fri May 2 22:33:29 2014
+++ lib/facter/processor.rb Fri May 2 22:33:47 2014
@@ -7,8 +7,8 @@
# On Linux and kFreeBSD, parse '/proc/cpuinfo' for each processor.
# On AIX, parse the output of 'lsdev' for its processor section.
# On Solaris, parse the output of 'kstat' for each processor.
-# On OpenBSD, use 'uname -p' and the sysctl variable for 'hw.ncpu' for CPU
-# count.
+# On OpenBSD, use the sysctl variables 'hw.model' and 'hw.ncpu'
+# for the CPU model and the CPU count respectively.
#
# Caveats:
#
@@ -88,11 +88,6 @@ Facter.add("ProcessorCount") do
end
end
-Facter.add("Processor") do
- confine :kernel => :openbsd
- setcode "uname -p"
-end
-
Facter.add("ProcessorCount") do
confine :kernel => :Darwin
setcode "sysctl -n hw.ncpu"
@@ -137,7 +132,7 @@ if Facter.value(:kernel) == "windows"
end
Facter.add("Processor") do
- confine :kernel => [:dragonfly,:freebsd]
+ confine :kernel => [:dragonfly,:freebsd,:openbsd]
setcode "sysctl -n hw.model"
end