summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorBrice Figureau <brice-puppet@daysofwonder.com>2008-12-06 16:53:03 +0100
committerBrice Figureau <brice-puppet@daysofwonder.com>2008-12-06 16:53:03 +0100
commit435f1e9b52e11bc558405f2102c61db84fea03c2 (patch)
tree7df108d0b3d6466490985e3136110178f5274253 /lib
parent6b30171435583b1a69c4ffe7b8b1760f5585cd38 (diff)
downloadpuppet-435f1e9b52e11bc558405f2102c61db84fea03c2.tar.gz
puppet-435f1e9b52e11bc558405f2102c61db84fea03c2.tar.xz
puppet-435f1e9b52e11bc558405f2102c61db84fea03c2.zip
Fix #1483 - use REST to transmit reports over the wire
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/puppet/indirector/report/rest.rb5
-rw-r--r--lib/puppet/transaction.rb12
-rw-r--r--lib/puppet/transaction/report.rb8
3 files changed, 13 insertions, 12 deletions
diff --git a/lib/puppet/indirector/report/rest.rb b/lib/puppet/indirector/report/rest.rb
new file mode 100644
index 000000000..905b71a5d
--- /dev/null
+++ b/lib/puppet/indirector/report/rest.rb
@@ -0,0 +1,5 @@
+require 'puppet/indirector/rest'
+
+class Puppet::Transaction::Report::Rest < Puppet::Indirector::REST
+ desc "Get server report over HTTP via REST."
+end
diff --git a/lib/puppet/transaction.rb b/lib/puppet/transaction.rb
index 0f94f5a12..83017222f 100644
--- a/lib/puppet/transaction.rb
+++ b/lib/puppet/transaction.rb
@@ -505,23 +505,13 @@ class Transaction
if Puppet[:report]
begin
- reportclient().report(report)
+ report.save()
rescue => detail
Puppet.err "Reporting failed: %s" % detail
end
end
end
- def reportclient
- unless defined? @reportclient
- @reportclient = Puppet::Network::Client.report.new(
- :Server => Puppet[:reportserver]
- )
- end
-
- @reportclient
- end
-
# Roll all completed changes back.
def rollback
@targets.clear
diff --git a/lib/puppet/transaction/report.rb b/lib/puppet/transaction/report.rb
index 89da7ed9c..e5b8650bb 100644
--- a/lib/puppet/transaction/report.rb
+++ b/lib/puppet/transaction/report.rb
@@ -11,7 +11,13 @@ class Puppet::Transaction::Report
indirects :report, :terminus_class => :processor
attr_accessor :logs, :metrics, :time, :host
-
+
+ # This is necessary since Marshall doesn't know how to
+ # dump hash with default proc (see below @records)
+ def self.default_format
+ :yaml
+ end
+
def <<(msg)
@logs << msg
return self