[Pkg-puppet-devel] [SCM] Puppet packaging for Debian branch, upstream, updated. 0.25.5-639-g8f94f35
Markus Roberts
Markus at reality.com
Wed Jul 14 10:36:00 UTC 2010
The following commit has been merged in the upstream branch:
commit 62e3b611e65deab60c615eac553cac9aa7e76d9d
Author: Matt Robinson <matt at puppetlabs.com>
Date: Wed Jun 30 15:33:17 2010 -0700
[#4090] Fix last few tests and renames of mode to run_mode
diff --git a/lib/puppet/network/authorization.rb b/lib/puppet/network/authorization.rb
index 7a61ab9..eb7690d 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 aa93068..e71d4ba 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 9aeed60..d0d2e0d 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 9200c58..56c5377 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 5cde2b7..99b0481 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
--
Puppet packaging for Debian
More information about the Pkg-puppet-devel
mailing list