diff options
| author | Luke Kanies <luke@madstop.com> | 2009-01-23 14:14:44 -0600 |
|---|---|---|
| committer | Luke Kanies <luke@madstop.com> | 2009-02-06 18:08:41 -0600 |
| commit | 54344591fde1a280f38032731e0ccb19521f6611 (patch) | |
| tree | 1d7424e390d06bbaa53612c46b529190694b53f3 /lib/puppet/resource | |
| parent | e65d7f11dd95ab5432adefeabc3179e9eb5dd050 (diff) | |
| download | puppet-54344591fde1a280f38032731e0ccb19521f6611.tar.gz puppet-54344591fde1a280f38032731e0ccb19521f6611.tar.xz puppet-54344591fde1a280f38032731e0ccb19521f6611.zip | |
Moving classfile-writing to the Catalog
This work was done by the Agent class before,
but it's really related to the catalog, so that's
where it is now.
Signed-off-by: Luke Kanies <luke@madstop.com>
Diffstat (limited to 'lib/puppet/resource')
| -rw-r--r-- | lib/puppet/resource/catalog.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/puppet/resource/catalog.rb b/lib/puppet/resource/catalog.rb index 0692b5ddd..8f013e7db 100644 --- a/lib/puppet/resource/catalog.rb +++ b/lib/puppet/resource/catalog.rb @@ -393,6 +393,17 @@ class Puppet::Resource::Catalog < Puppet::SimpleGraph to_catalog :to_resource end + # Store the classes in the classfile. + def write_class_file + begin + ::File.open(Puppet[:classfile], "w") do |f| + f.puts classes.join("\n") + end + rescue => detail + Puppet.err "Could not create class file %s: %s" % [Puppet[:classfile], detail] + end + end + # Produce the graph files if requested. def write_graph(name) # We only want to graph the main host catalog. |
