Signed-off-by: James Turnbull <[email protected]>
---
lib/facter/memory.rb | 14 +++++++-------
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
--
1.6.6.1
--
You received this message because you are subscribed to the Google Groups
"Puppet Developers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/puppet-dev?hl=en.