summaryrefslogtreecommitdiffstats
path: root/ext
diff options
context:
space:
mode:
authorJames Turnbull <james@lovedthanlost.net>2008-08-01 07:11:21 +1000
committerJames Turnbull <james@lovedthanlost.net>2008-08-01 07:11:56 +1000
commit2a3d195402900aa31843f7a7ff78026409cf43f5 (patch)
tree45950228cc66859dc858dc50b8dea80816781fb0 /ext
parentc97389d5f6748c05b88f6461b87b4d21a273ab00 (diff)
downloadpuppet-2a3d195402900aa31843f7a7ff78026409cf43f5.tar.gz
puppet-2a3d195402900aa31843f7a7ff78026409cf43f5.tar.xz
puppet-2a3d195402900aa31843f7a7ff78026409cf43f5.zip
Specs for yaml indirector .search - I'm still learning!
Updated, I was calling .base myself instead of the actual string
Diffstat (limited to 'ext')
-rwxr-xr-xext/puppetlast27
1 files changed, 0 insertions, 27 deletions
diff --git a/ext/puppetlast b/ext/puppetlast
index 848fdde6c..d9b698cfe 100755
--- a/ext/puppetlast
+++ b/ext/puppetlast
@@ -10,33 +10,6 @@ Puppet.parse_config
Puppet[:name] = "puppetmasterd"
Puppet::Node::Facts.terminus_class = :yaml
-print "puppetlast\n"
-
-nodes = {}
-
-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
-
Puppet::Node::Facts.search("*").sort.each do |node|
puts "#{node.name} #{node.expired? ? 'cached expired, ' : ''}checked in #{((Time.now - node.values[:_timestamp]) / 60).floor} minutes ago"
end
-