diff options
| author | Luke Kanies <luke@madstop.com> | 2007-12-22 21:44:37 -0600 |
|---|---|---|
| committer | Luke Kanies <luke@madstop.com> | 2007-12-22 21:44:37 -0600 |
| commit | 1deb7fd487dca1046beb933dca2cccadf44fa6f5 (patch) | |
| tree | 06343d67499adecb28c4465fd15c92ad9336e109 /lib/puppet/node/catalog.rb | |
| parent | f3fd7091d3db9dff1b177867589289890e9a3a66 (diff) | |
| parent | c4ed43c2a1ad9ab865e3da6b8b7fad28222c3451 (diff) | |
| download | puppet-1deb7fd487dca1046beb933dca2cccadf44fa6f5.tar.gz puppet-1deb7fd487dca1046beb933dca2cccadf44fa6f5.tar.xz puppet-1deb7fd487dca1046beb933dca2cccadf44fa6f5.zip | |
Merge branch '0.24.x'
Conflicts:
conf/redhat/puppet.spec
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| |
