summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorJames Turnbull <james@lovedthanlost.net>2010-06-10 16:13:46 +1000
committerJames Turnbull <james@lovedthanlost.net>2010-06-18 02:54:14 +1000
commit1bd2ca29d8fd7d11e75096ceeeb704fe887cad31 (patch)
tree8d01a9d7754486a0f2c3f0129c83c62d2e2d50d9 /lib
parent8106bc3f000d0e18969c4ec142ef84fbc780b30a (diff)
Fixed #3929 - Added user confine to AIX memory facts
Diffstat (limited to 'lib')
-rw-r--r--lib/facter/memory.rb14
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/facter/memory.rb b/lib/facter/memory.rb
index f0f0d45..06640e6 100644
--- a/lib/facter/memory.rb
+++ b/lib/facter/memory.rb
@@ -20,16 +20,16 @@ require 'facter/util/memory'
end
end
-if Facter.value(:kernel) == "AIX"
+if Facter.value(:kernel) == "AIX" and Facter.value(:id) == "root"
swap = Facter::Util::Resolution.exec('swap -l')
swapfree, swaptotal = 0, 0
swap.each do |dev|
- if dev =~ /^\/\S+\s.*\s+(\S+)MB\s+(\S+)MB/
- swaptotal += $1.to_i
- swapfree += $2.to_i
- end
- end
-
+ if dev =~ /^\/\S+\s.*\s+(\S+)MB\s+(\S+)MB/
+ swaptotal += $1.to_i
+ swapfree += $2.to_i
+ end
+ end
+
Facter.add("SwapSize") do
confine :kernel => :aix
setcode do