diff options
author | Luke Kanies <luke@madstop.com> | 2008-02-13 08:56:06 -0600 |
---|---|---|
committer | Luke Kanies <luke@madstop.com> | 2008-02-13 08:56:06 -0600 |
commit | 068b61e022c42fb12a5c657cb9d1ebbd98c7ca38 (patch) | |
tree | 37d7795a61370d86fd6a4df5c8f4ab6c4fdeb80b | |
parent | 98dbfa2865ad270d5fd9821c6518f6f30ce9aec4 (diff) | |
download | puppet-068b61e022c42fb12a5c657cb9d1ebbd98c7ca38.tar.gz puppet-068b61e022c42fb12a5c657cb9d1ebbd98c7ca38.tar.xz puppet-068b61e022c42fb12a5c657cb9d1ebbd98c7ca38.zip |
Removing obsolete references (they're in the indirection
reference), and adding error handling to puppetdoc.
-rwxr-xr-x | bin/puppetdoc | 18 | ||||
-rw-r--r-- | lib/puppet/reference/node_source.rb | 9 | ||||
-rw-r--r-- | lib/puppet/reference/report.rb | 21 |
3 files changed, 14 insertions, 34 deletions
diff --git a/bin/puppetdoc b/bin/puppetdoc index be86cc618..82e4c076b 100755 --- a/bin/puppetdoc +++ b/bin/puppetdoc @@ -128,11 +128,19 @@ else else with_contents = true end + exit_code = 0 options[:references].sort { |a,b| a.to_s <=> b.to_s }.each do |name| - section = Puppet::Util::Reference.reference(name) - - # Add the per-section text, but with no ToC - text += section.send(options[:format], with_contents) + raise "Could not find reference %s" % name unless section = Puppet::Util::Reference.reference(name) + + begin + # Add the per-section text, but with no ToC + text += section.send(options[:format], with_contents) + rescue => detail + puts detail.backtrace + $stderr.puts "Could not generate reference %s: %s" % [name, detail] + exit_code = 1 + next + end end unless with_contents # We've only got one reference @@ -147,6 +155,8 @@ else else puts text end + + exit exit_code end diff --git a/lib/puppet/reference/node_source.rb b/lib/puppet/reference/node_source.rb deleted file mode 100644 index 29a01f850..000000000 --- a/lib/puppet/reference/node_source.rb +++ /dev/null @@ -1,9 +0,0 @@ -require 'puppet/node' - -noderef = Puppet::Util::Reference.newreference :node_source, :doc => "Sources of node configuration information" do - Puppet::Network::Handler.node.docs -end - -noderef.header = " -Nodes can be searched for in different locations. This document describes those different locations. -" diff --git a/lib/puppet/reference/report.rb b/lib/puppet/reference/report.rb deleted file mode 100644 index a8086f8bc..000000000 --- a/lib/puppet/reference/report.rb +++ /dev/null @@ -1,21 +0,0 @@ -report = Puppet::Util::Reference.newreference :report, :doc => "All available transaction reports" do - Puppet::Network::Handler.report.reportdocs -end - -report.header = " -Puppet clients can report back to the server after each transaction. This -transaction report is sent as a YAML dump of the -``Puppet::Transaction::Report`` class and includes every log message that was -generated during the transaction along with as many metrics as Puppet knows how -to collect. See `ReportsAndReporting Reports and Reporting`:trac: -for more information on how to use reports. - -Currently, clients default to not sending in reports; you can enable reporting -by setting the ``report`` parameter to true. - -To use a report, set the ``reports`` parameter on the server; multiple -reports must be comma-separated. You can also specify ``none`` to disable -reports entirely. - -Puppet provides multiple report handlers that will process client reports: -" |