summaryrefslogtreecommitdiffstats
path: root/lib/puppet/network/client
diff options
context:
space:
mode:
authorluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2007-05-04 05:04:29 +0000
committerluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2007-05-04 05:04:29 +0000
commit28254b55cc65d572e9036046d7765c6dd7505e70 (patch)
tree5ae1067534c9bdf6de73a79836afb3ba84438d36 /lib/puppet/network/client
parent0c07125397428a0c1ca9a4a4d0176f45d8be0979 (diff)
downloadpuppet-28254b55cc65d572e9036046d7765c6dd7505e70.tar.gz
puppet-28254b55cc65d572e9036046d7765c6dd7505e70.tar.xz
puppet-28254b55cc65d572e9036046d7765c6dd7505e70.zip
Adding a --summarize option, to get a transaction summary
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2459 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'lib/puppet/network/client')
-rw-r--r--lib/puppet/network/client/master.rb25
1 files changed, 19 insertions, 6 deletions
diff --git a/lib/puppet/network/client/master.rb b/lib/puppet/network/client/master.rb
index b967729b5..9c1aed8ee 100644
--- a/lib/puppet/network/client/master.rb
+++ b/lib/puppet/network/client/master.rb
@@ -74,7 +74,7 @@ class Puppet::Network::Client::Master < Puppet::Network::Client
Puppet::Util::Storage.store
end
- if Puppet[:report]
+ if Puppet[:report] or Puppet[:summarize]
report(transaction)
end
@@ -501,12 +501,25 @@ class Puppet::Network::Client::Master < Puppet::Network::Client
def report(transaction)
begin
report = transaction.generate_report()
- if Puppet[:rrdgraph] == true
- report.graph()
- end
- reportclient().report(report)
rescue => detail
- Puppet.err "Reporting failed: %s" % detail
+ Puppet.err "Could not generate report: %s" % detail
+ return
+ end
+
+ if Puppet[:rrdgraph] == true
+ report.graph()
+ end
+
+ if Puppet[:summarize]
+ puts report.summary
+ end
+
+ if Puppet[:report]
+ begin
+ reportclient().report(report)
+ rescue => detail
+ Puppet.err "Reporting failed: %s" % detail
+ end
end
end