summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve Hajducko <sjmh@phase2.net>2008-06-16 16:12:20 -0700
committerSteve Hajducko <sjmh@phase2.net>2008-06-16 16:12:20 -0700
commit9a1882e9b2f6d2372567557a3935649b4be3f661 (patch)
treecc9d1eb9d5d4a0580bdccf3651ea1f16f7c2db49
parent967631f91edd070ea6403bd528e8881c7daed8ba (diff)
downloadfacter-9a1882e9b2f6d2372567557a3935649b4be3f661.tar.gz
facter-9a1882e9b2f6d2372567557a3935649b4be3f661.tar.xz
facter-9a1882e9b2f6d2372567557a3935649b4be3f661.zip
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 <sjmh@phase2.net>
-rw-r--r--lib/facter/hardwaremodel.rb7
1 files changed, 6 insertions, 1 deletions
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