diff options
author | Luke Kanies <luke@madstop.com> | 2008-11-06 11:55:34 -0600 |
---|---|---|
committer | Luke Kanies <luke@madstop.com> | 2008-11-06 11:55:34 -0600 |
commit | e92c1cc724c489d9328567dfa082221a67184c92 (patch) | |
tree | 9ab1eeb6a0c49384550e8fd0ace1db3b2c0ae63d /lib | |
parent | 0149e2e125fc09bb5a8c1ff206cd46e06c0593cd (diff) | |
download | puppet-e92c1cc724c489d9328567dfa082221a67184c92.tar.gz puppet-e92c1cc724c489d9328567dfa082221a67184c92.tar.xz puppet-e92c1cc724c489d9328567dfa082221a67184c92.zip |
Moving Catalog#write_graph to SimpleGraph, where it belongs.
Signed-off-by: Luke Kanies <luke@madstop.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/puppet/simple_graph.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/puppet/simple_graph.rb b/lib/puppet/simple_graph.rb index 48f393f77..c926258ca 100644 --- a/lib/puppet/simple_graph.rb +++ b/lib/puppet/simple_graph.rb @@ -315,4 +315,16 @@ class Puppet::SimpleGraph system( "dot -T#{fmt} #{src} -o #{dot}" ) dot end + + # Produce the graph files if requested. + def write_graph(name) + return unless Puppet[:graph] + + Puppet.settings.use(:graphing) + + file = File.join(Puppet[:graphdir], "%s.dot" % name.to_s) + File.open(file, "w") { |f| + f.puts to_dot("name" => name.to_s.capitalize) + } + end end |