I hadn't tested .sort.each on a setup with more than one node, and
Puppet::Node::Facts obviously doesn't have an <=> method.
This implements a simple string sort based on the node name
Signed-off-by: AJ Christensen <[EMAIL PROTECTED]>
---
ext/puppetlast | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/ext/puppetlast b/ext/puppetlast
index d9b698c..e52529d 100755
--- a/ext/puppetlast
+++ b/ext/puppetlast
@@ -10,6 +10,6 @@ Puppet.parse_config
Puppet[:name] = "puppetmasterd"
Puppet::Node::Facts.terminus_class = :yaml
-Puppet::Node::Facts.search("*").sort.each do |node|
+Puppet::Node::Facts.search("*").sort { |a,b| a.name <=> b.name }.each do |node|
puts "#{node.name} #{node.expired? ? 'cached expired, ' : ''}checked in
#{((Time.now - node.values[:_timestamp]) / 60).floor} minutes ago"
end
--
1.5.6.GIT
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---