Greetings!

Please review the pull request #76: Fixed #9258 - Puppet Rack logging opened by (jamtur01)

Some more information about the pull request:

  • Opened: Tue Aug 30 18:05:05 UTC 2011
  • Based on: puppetlabs:master (98db04eb290ad7767cbc6da43c0ab94971f0d8ef)
  • Requested merge: jamtur01:tickets/master/9258 (7e79e07572a436fdb9d172d904410dc7c2954467)

Description:

Puppet Master as Rack application ignores syslogfacility

Attempting to define a syslogfacility in the config file (under [main]
or [master], makes no difference) or in ARGV in rack/config.ru when
running Puppet as Rack app through Passenger will not apply the setting,
and it will stubbornly log with the default settings to syslog.

This can be traced back to the fact that both daemon.rb and
network/server.rb (during daemonize) call Puppet::Util::Log.reopen, but
when using Rack, network/http/rack.rb will be used, which never does.

This add reopen to rack.rb and a test

Thanks!
The Pull Request Bot

Diff follows:

diff --git a/lib/puppet/network/http/rack.rb b/lib/puppet/network/http/rack.rb
index 5b4ef7e..37d834c 100644
--- a/lib/puppet/network/http/rack.rb
+++ b/lib/puppet/network/http/rack.rb
@@ -10,6 +10,7 @@ require 'puppet/network/http/rack/xmlrpc'
 class Puppet::Network::HTTP::Rack
 
   def initialize(args)
+    Puppet::Util::Log.reopen
     raise ArgumentError, ":protocols must be specified." if !args[:protocols] or args[:protocols].empty?
     protocols = args[:protocols]
 
diff --git a/spec/unit/network/http/rack_spec.rb b/spec/unit/network/http/rack_spec.rb
index 9e1ee3d..ddeeeef 100755
--- a/spec/unit/network/http/rack_spec.rb
+++ b/spec/unit/network/http/rack_spec.rb
@@ -6,6 +6,11 @@ require 'puppet/network/http/rack' if Puppet.features.rack?
 describe "Puppet::Network::HTTP::Rack", :if => Puppet.features.rack? do
   describe "while initializing" do
 
+    it "should reopen logs" do
+      Puppet::Util::Log.expects(:reopen)
+      Puppet::Network::HTTP::Rack.new({:protocols => [:rest]})
+    end
+
     it "should require a protocol specification" do
       Proc.new { Puppet::Network::HTTP::Rack.new({}) }.should raise_error(ArgumentError)
     end

    

--
You received this message because you are subscribed to the Google Groups "Puppet Developers" group.
To post to this group, send email to puppet-dev@googlegroups.com.
To unsubscribe from this group, send email to puppet-dev+unsubscr...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/puppet-dev?hl=en.

Reply via email to