[#4090] Fix last few tests and renames of mode to run_mode

This commit is contained in:
Matt Robinson 2010-06-30 15:33:17 -07:00 коммит произвёл Markus Roberts
Родитель 2a2588392a
Коммит 62e3b611e6
5 изменённых файлов: 5 добавлений и 15 удалений

Просмотреть файл

@ -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

Просмотреть файл

@ -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]

Просмотреть файл

@ -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

Просмотреть файл

@ -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")

Просмотреть файл

@ -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