[Pkg-puppet-devel] [SCM] Packaging of Facter for debian branch, upstream, updated. 51bcebe38cab6088c901f1006339bbe40a36d161

James Turnbull james at lovedthanlost.net
Wed Aug 18 05:55:52 UTC 2010


The following commit has been merged in the upstream branch:
commit 1bd2ca29d8fd7d11e75096ceeeb704fe887cad31
Author: James Turnbull <james at lovedthanlost.net>
Date:   Thu Jun 10 16:13:46 2010 +1000

    Fixed #3929 - Added user confine to AIX memory facts

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

-- 
Packaging of Facter for debian



More information about the Pkg-puppet-devel mailing list