1. Removed legacy masterlog and puppetdlog options
2. Renamed logopts to log_dir for consistency
3. Fixed related tests

Signed-off-by: James Turnbull <[email protected]>
---
 lib/puppet/application.rb              |    2 +-
 lib/puppet/defaults.rb                 |   14 +-------------
 lib/puppet/util/run_mode.rb            |    2 +-
 spec/unit/network/http/webrick_spec.rb |   10 +++++-----
 spec/unit/util/run_mode_spec.rb        |    8 ++++----
 test/puppet/defaults.rb                |    2 +-
 6 files changed, 13 insertions(+), 25 deletions(-)

diff --git a/lib/puppet/application.rb b/lib/puppet/application.rb
index f0159a6..e7e359e 100644
--- a/lib/puppet/application.rb
+++ b/lib/puppet/application.rb
@@ -270,7 +270,7 @@ class Application
       Puppet.settings.set_value(:confdir, Puppet.run_mode.conf_dir, 
:mutable_defaults)
       Puppet.settings.set_value(:vardir, Puppet.run_mode.var_dir, 
:mutable_defaults)
       Puppet.settings.set_value(:name, Puppet.application_name.to_s, 
:mutable_defaults)
-      Puppet.settings.set_value(:logdir, Puppet.run_mode.logopts, 
:mutable_defaults)
+      Puppet.settings.set_value(:logdir, Puppet.run_mode.log_dir, 
:mutable_defaults)
       Puppet.settings.set_value(:rundir, Puppet.run_mode.run_dir, 
:mutable_defaults)
       Puppet.settings.set_value(:run_mode, Puppet.run_mode.name.to_s, 
:mutable_defaults)
     end
diff --git a/lib/puppet/defaults.rb b/lib/puppet/defaults.rb
index 4521a59..5002893 100644
--- a/lib/puppet/defaults.rb
+++ b/lib/puppet/defaults.rb
@@ -10,7 +10,7 @@ module Puppet
     :run_mode => [Puppet.run_mode.name.to_s, "The effective 'run mode' of the 
application: master, agent, or user."]
   )
 
-  setdefaults(:main, :logdir => Puppet.run_mode.logopts)
+  setdefaults(:main, :logdir => Puppet.run_mode.log_dir)
 
   setdefaults(:main,
     :trace => [false, "Whether to print stack traces on some errors"],
@@ -386,13 +386,6 @@ module Puppet
     :code => ["", "Code to parse directly.  This is essentially only used
       by `puppet`, and should only be set if you're writing your own Puppet
       executable"],
-    :masterlog => { :default => "$logdir/puppetmaster.log",
-      :owner => "service",
-      :group => "service",
-      :mode => 0660,
-      :desc => "Where puppet master logs.  This is generally not used,
-        since syslog is the default log destination."
-    },
     :masterhttplog => { :default => "$logdir/masterhttp.log",
       :owner => "service",
       :group => "service",
@@ -492,11 +485,6 @@ module Puppet
         associated with the retrieved configuration.  Can be loaded in
         the separate `puppet` executable using the `--loadclasses`
         option."},
-    :puppetdlog => { :default => "$logdir/puppetd.log",
-      :owner => "root",
-      :mode => 0640,
-      :desc => "The log file for puppet agent.  This is generally not used."
-    },
     :server => ["puppet", "The server to which server puppet agent should 
connect"],
     :ignoreschedules => [false,
       "Boolean; whether puppet agent should ignore schedules.  This is useful
diff --git a/lib/puppet/util/run_mode.rb b/lib/puppet/util/run_mode.rb
index 450cbf1..a7e7b04 100644
--- a/lib/puppet/util/run_mode.rb
+++ b/lib/puppet/util/run_mode.rb
@@ -43,7 +43,7 @@ module Puppet
         "$vardir/run"
       end
 
-      def logopts
+      def log_dir
         if master?
           {
             :default => "$vardir/log",
diff --git a/spec/unit/network/http/webrick_spec.rb 
b/spec/unit/network/http/webrick_spec.rb
index 8e7c92b..8d4cdc4 100755
--- a/spec/unit/network/http/webrick_spec.rb
+++ b/spec/unit/network/http/webrick_spec.rb
@@ -212,20 +212,20 @@ describe Puppet::Network::HTTP::WEBrick do
       @server.setup_logger
     end
 
-    it "should use the masterlog if the run_mode is master" do
+    it "should use the masterhttplog if the run_mode is master" do
       Puppet.run_mode.stubs(:master?).returns(true)
-      Puppet.settings.expects(:value).with(:masterhttplog).returns 
"/master/log"
+      Puppet.settings.expects(:value).with(:masterhttplog).returns 
"/master/httplog"
 
-      File.expects(:open).with("/master/log", "a+").returns @filehandle
+      File.expects(:open).with("/master/httplog", "a+").returns @filehandle
 
       @server.setup_logger
     end
 
     it "should use the httplog if the run_mode is not master" do
       Puppet.run_mode.stubs(:master?).returns(false)
-      Puppet.settings.expects(:value).with(:httplog).returns "/other/log"
+      Puppet.settings.expects(:value).with(:httplog).returns "/other/httplog"
 
-      File.expects(:open).with("/other/log", "a+").returns @filehandle
+      File.expects(:open).with("/other/httplog", "a+").returns @filehandle
 
       @server.setup_logger
     end
diff --git a/spec/unit/util/run_mode_spec.rb b/spec/unit/util/run_mode_spec.rb
index d6ab08a..1ce1aa0 100644
--- a/spec/unit/util/run_mode_spec.rb
+++ b/spec/unit/util/run_mode_spec.rb
@@ -33,14 +33,14 @@ describe Puppet::Util::RunMode do
     @run_mode.run_dir.should == '$vardir/run'
   end
 
-  it "should have logopts return an array with $vardir/log if runmode is not 
master" do
+  it "should have log_dir return an array with $vardir/log if runmode is not 
master" do
     @run_mode.expects(:master?).returns false
-    @run_mode.logopts.should == ["$vardir/log", "The Puppet log directory."]
+    @run_mode.log_dir.should == ["$vardir/log", "The Puppet log directory."]
   end
 
-  it "should have logopts return a hash with $vardir/log and other metadata if 
runmode is master" do
+  it "should have log_dir return a hash with $vardir/log and other metadata if 
runmode is master" do
     @run_mode.expects(:master?).returns true
-    @run_mode.logopts.should == {
+    @run_mode.log_dir.should == {
       :default => "$vardir/log",
       :mode    => 0750,
       :owner   => "service",
diff --git a/test/puppet/defaults.rb b/test/puppet/defaults.rb
index d290cef..91343d5 100755
--- a/test/puppet/defaults.rb
+++ b/test/puppet/defaults.rb
@@ -9,7 +9,7 @@ require 'puppettest'
 class TestPuppetDefaults < Test::Unit::TestCase
   include PuppetTest
   @@dirs = %w{rrddir confdir vardir logdir statedir}
-  @@files = %w{statefile manifest masterlog}
+  @@files = %w{statefile manifest}
   @@normals = %w{puppetport masterport server}
   @@booleans = %w{noop}
 
-- 
1.7.3.4

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

Reply via email to