diff options
| author | Luke Kanies <luke@madstop.com> | 2007-12-21 17:52:06 -0600 |
|---|---|---|
| committer | Luke Kanies <luke@madstop.com> | 2007-12-21 17:52:06 -0600 |
| commit | c59ff622a33b82f413207a146edd4ff6e011e729 (patch) | |
| tree | 7d7efd74b8aab5c8e9c0bbf7a3f90304edae9caf /lib/puppet/node | |
| parent | 4d28b10cd1ac8b549d488f18d272ad589c75445d (diff) | |
| download | puppet-c59ff622a33b82f413207a146edd4ff6e011e729.tar.gz puppet-c59ff622a33b82f413207a146edd4ff6e011e729.tar.xz puppet-c59ff622a33b82f413207a146edd4ff6e011e729.zip | |
Further fixes toward #965. Turned out that the previous fix
caused other problems.
This whole thing will hopefully get *drastically* easier once we
get rid of global resources.
Diffstat (limited to 'lib/puppet/node')
| -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| |
