From 9a1882e9b2f6d2372567557a3935649b4be3f661 Mon Sep 17 00:00:00 2001 From: Steve Hajducko Date: Mon, 16 Jun 2008 16:12:20 -0700 Subject: Retrieve hardwaremodel for AIX from sys0 modelname. Currently gets hardwaremodel from proc0 but some systems don't have a proc0 device configured so the fact fails. tickets/1.5/1364 Signed-off-by: Steve Hajducko --- lib/facter/hardwaremodel.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/facter/hardwaremodel.rb b/lib/facter/hardwaremodel.rb index b69848d..de5db3f 100644 --- a/lib/facter/hardwaremodel.rb +++ b/lib/facter/hardwaremodel.rb @@ -4,5 +4,10 @@ Facter.add(:hardwaremodel) do confine :operatingsystem => :aix - setcode 'lsattr -El proc0 -a type|cut -f2 -d" "' + setcode do + model = Facter::Util::Resolution.exec('lsattr -El sys0 -a modelname') + if model =~ /modelname\s(\S+)\s/ + $1 + end + end end -- cgit