summaryrefslogtreecommitdiffstats
path: root/lib/puppet/interface/report.rb
blob: 56a58f6aab826b0de2414a2ea9d580f1cb58cdb1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
require 'puppet/interface/indirector'

Puppet::Interface::Indirector.interface(:report) do
  action(:submit) do
    invoke do |report|
      begin
        Puppet::Transaction::Report.terminus_class = :rest
        report.save
      rescue => detail
        puts detail.backtrace if Puppet[:trace]
        Puppet.err "Could not send report: #{detail}"
      end
    end
  end
end