summaryrefslogtreecommitdiffstats
path: root/lib/puppet/simple_graph.rb
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2008-11-06 11:55:34 -0600
committerLuke Kanies <luke@madstop.com>2008-11-06 11:55:34 -0600
commite92c1cc724c489d9328567dfa082221a67184c92 (patch)
tree9ab1eeb6a0c49384550e8fd0ace1db3b2c0ae63d /lib/puppet/simple_graph.rb
parent0149e2e125fc09bb5a8c1ff206cd46e06c0593cd (diff)
downloadpuppet-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/puppet/simple_graph.rb')
-rw-r--r--lib/puppet/simple_graph.rb12
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