diff options
Diffstat (limited to 'lib/puppet/node/catalog.rb')
| -rw-r--r-- | lib/puppet/node/catalog.rb | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/lib/puppet/node/catalog.rb b/lib/puppet/node/catalog.rb index a02d59ae9..c9de2019d 100644 --- a/lib/puppet/node/catalog.rb +++ b/lib/puppet/node/catalog.rb @@ -260,6 +260,8 @@ class Puppet::Node::Catalog < Puppet::PGraph # Make sure all of our resources are "finished". def finalize + make_default_resources + @resource_table.values.each { |resource| resource.finish } write_graph(:resources) @@ -287,6 +289,20 @@ class Puppet::Node::Catalog < Puppet::PGraph finalize() end end + + # Make the default objects necessary for function. + def make_default_resources + # We have to add the resources to the catalog, or else they won't get cleaned up after + # the transaction. + + # First create the default scheduling objects + Puppet::Type.type(:schedule).mkdefaultschedules.each { |res| add_resource(res) unless resource(res.ref) } + + # And filebuckets + if bucket = Puppet::Type.type(:filebucket).mkdefaultbucket + add_resource(bucket) + end + end # Create a graph of all of the relationships in our catalog. def relationship_graph @@ -367,6 +383,11 @@ class Puppet::Node::Catalog < Puppet::PGraph end end + # Return an array of all resources. + def resources + @resource_table.keys + end + # Add a tag. def tag(*names) names.each do |name| |
