[Pkg-puppet-devel] [SCM] Puppet packaging for Debian branch, master, updated. debian/0.24.6-1-356-g5718585

James Turnbull james at lovedthanlost.net
Fri Jan 23 14:20:44 UTC 2009


The following commit has been merged in the master branch:
commit 482489ad21e20ee3275185962f76c6a0c9a88328
Author: James Turnbull <james at lovedthanlost.net>
Date:   Fri Aug 1 06:59:23 2008 +1000

    Revert "Fixing puppetlast to make it work with 0.24.5 / 0.25."
    
    This reverts commit 971af69b7388cf5155bb124246f2a697578cc6e9.

diff --git a/ext/puppetlast b/ext/puppetlast
index c77d1ba..e8c2ea1 100755
--- a/ext/puppetlast
+++ b/ext/puppetlast
@@ -15,21 +15,26 @@ print "puppetlast\n"
 
 nodes = {}
 
-factsdir = Puppet.settings.value(:vardir) + "/yaml/facts"
-
-begin
-  Dir.chdir(factsdir) if File.exists?(factsdir)
-  Dir.glob("*.yaml").each do |yaml|
-    data = YAML.load_file(yaml)
-    age = Time.now - data.values[:_timestamp]
-    nodes[data.name] = age.to_i
-  end
-
-  nodes.sort.each do |node,age|
-    minutes = age / 60
-    puts minutes.floor.to_s + ' minutes ago: ' + node 
-  end
-
-rescue
-  puts 'error: ' + $!
+yfdir = Puppet.settings.value(:vardir) + "/yaml/facts"
+
+if yfdir
+   begin
+      Dir.chdir(yfdir) do
+         Dir.glob("*.yaml").each do |yaml|
+            data = YAML.load_file(yaml)
+            t = Time.now
+            age = t - data.version
+            nodes[data.name] = age.to_i
+         end
+      end
+
+      nodes.sort.each do |node,age|
+         minutes = age / 60 + 0.5
+         print minutes.floor.to_s + ' minutes ago: ' + node + "\n"
+      end
+
+   rescue
+      print 'error: ' + $! + "\n"
+   end
+
 end

-- 
Puppet packaging for Debian



More information about the Pkg-puppet-devel mailing list