summaryrefslogtreecommitdiffstats
path: root/lib/puppet/resource
diff options
context:
space:
mode:
authorJesse Wolfe <jes5199@gmail.com>2011-01-03 16:28:24 -0800
committerJesse Wolfe <jes5199@gmail.com>2011-01-03 16:28:24 -0800
commit7661ba82a3c765d4bf8a400a3c770f351c541f96 (patch)
tree89e9736c4357dd17ef6bc128af11890a5f93a64e /lib/puppet/resource
parent10f89de6e55429fcb055b15a513d01e6e20f03b9 (diff)
downloadpuppet-7661ba82a3c765d4bf8a400a3c770f351c541f96.tar.gz
puppet-7661ba82a3c765d4bf8a400a3c770f351c541f96.tar.xz
puppet-7661ba82a3c765d4bf8a400a3c770f351c541f96.zip
maint: Prune #inspect methods on various objects
Ruby's default #inspect method can lead to printing factorial-order output for large graphs of objects. Since we have large graphs of objects, this is not optimal. This patch replaces a few well-connected objects' #inspect methods with methods that produce reduced output, and are thus much faster. Paired-With: Nick Lewis <nick@puppetlabs.com>
Diffstat (limited to 'lib/puppet/resource')
-rw-r--r--lib/puppet/resource/type_collection.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/puppet/resource/type_collection.rb b/lib/puppet/resource/type_collection.rb
index 6a03458b3..277d37b18 100644
--- a/lib/puppet/resource/type_collection.rb
+++ b/lib/puppet/resource/type_collection.rb
@@ -19,6 +19,10 @@ class Puppet::Resource::TypeCollection
@watched_files = {}
end
+ def inspect
+ "TypeCollection" + { :hostclasses => @hostclasses.keys, :definitions => @definitions.keys, :nodes => @nodes.keys }.inspect
+ end
+
def <<(thing)
add(thing)
self