summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt Robinson <matt@puppetlabs.com>2010-06-30 15:33:17 -0700
committerMarkus Roberts <Markus@reality.com>2010-07-01 13:48:03 -0700
commit62e3b611e65deab60c615eac553cac9aa7e76d9d (patch)
tree013b9b130a3aaf973b7517b19dc6e944c0f9d688
parent2a2588392a2eead4265afcb93ff7bc16b5fc1ef1 (diff)
downloadpuppet-62e3b611e65deab60c615eac553cac9aa7e76d9d.tar.gz
puppet-62e3b611e65deab60c615eac553cac9aa7e76d9d.tar.xz
puppet-62e3b611e65deab60c615eac553cac9aa7e76d9d.zip
[#4090] Fix last few tests and renames of mode to run_mode
-rw-r--r--lib/puppet/network/authorization.rb2
-rw-r--r--lib/puppet/network/http_server/webrick.rb2
-rwxr-xr-xspec/unit/util/settings_spec.rb10
-rwxr-xr-xtest/network/authorization.rb4
-rwxr-xr-xtest/network/server/webrick.rb2
5 files changed, 5 insertions, 15 deletions
diff --git a/lib/puppet/network/authorization.rb b/lib/puppet/network/authorization.rb
index 7a61ab9b9..eb7690db4 100644
--- a/lib/puppet/network/authorization.rb
+++ b/lib/puppet/network/authorization.rb
@@ -34,7 +34,7 @@ module Puppet::Network
return false
end
else
- if Puppet.mode.master?
+ if Puppet.run_mode.master?
Puppet.debug "Allowing " + msg
return true
else
diff --git a/lib/puppet/network/http_server/webrick.rb b/lib/puppet/network/http_server/webrick.rb
index aa930681b..e71d4ba14 100644
--- a/lib/puppet/network/http_server/webrick.rb
+++ b/lib/puppet/network/http_server/webrick.rb
@@ -45,7 +45,7 @@ module Puppet
# yuck; separate http logs
file = nil
Puppet.settings.use(:main, :ssl, Puppet[:name])
- if Puppet.mode.master?
+ if Puppet.run_mode.master?
file = Puppet[:masterhttplog]
else
file = Puppet[:httplog]
diff --git a/spec/unit/util/settings_spec.rb b/spec/unit/util/settings_spec.rb
index 9aeed60f8..d0d2e0db8 100755
--- a/spec/unit/util/settings_spec.rb
+++ b/spec/unit/util/settings_spec.rb
@@ -277,16 +277,6 @@ describe Puppet::Util::Settings do
it "should have a run_mode that defaults to user" do
@settings.run_mode.should == :user
end
-
- it "should not give a shit if you set a default run_mode yourself" do
- @settings.setdefaults(:whatever, :run_mode => ["something", "yayness"])
- lambda{ @settings[:run_mode] = :other }.should raise_error(ArgumentError, /read-only/)
- end
-
- it "CURRENTLY should not allow the user to set a run_mode default" do
- @settings.setdefaults(:whatever, :run_mode => ["something", "yayness"])
- @settings.run_mode.should == :user
- end
end
describe "when choosing which value to return" do
diff --git a/test/network/authorization.rb b/test/network/authorization.rb
index 9200c5824..56c537773 100755
--- a/test/network/authorization.rb
+++ b/test/network/authorization.rb
@@ -82,8 +82,8 @@ class TestAuthConfig < Test::Unit::TestCase
assert(! @obj.authorized?(@request), "Allowed call with no config file")
assert_logged(:notice, /Denying/, "did not log call")
- # Now set our mode to master, so calls are allowed
- Puppet.mode.stubs(:master?).returns true
+ # Now set our run_mode to master, so calls are allowed
+ Puppet::Util::RunMode.any_instance.stubs(:master?).returns true
assert(@obj.authorized?(@request),
"Denied call with no config file and master")
assert_logged(:debug, /Allowing/, "did not log call")
diff --git a/test/network/server/webrick.rb b/test/network/server/webrick.rb
index 5cde2b756..99b04817c 100755
--- a/test/network/server/webrick.rb
+++ b/test/network/server/webrick.rb
@@ -93,7 +93,7 @@ class TestWebrickServer < Test::Unit::TestCase
}
pid = fork {
- Puppet.mode.stubs(:master?).returns(true)
+ Puppet::Util::RunMode.any_instance.stubs(:master?).returns true
assert_nothing_raised() {
trap(:INT) { server.shutdown }
server.start