diff options
| author | Jesse Wolfe <jes5199@gmail.com> | 2010-05-12 18:25:14 -0700 |
|---|---|---|
| committer | test branch <puppet-dev@googlegroups.com> | 2010-02-17 06:50:53 -0800 |
| commit | ac7efc8f0284d6b35f5428da06ba371cf94998ec (patch) | |
| tree | c1a6a6df5dd2d533c1d0b12b869a0758b8c4cb6f /lib/puppet/network | |
| parent | 5665e3984f73c70b90f65dd8bf4445b5adda5121 (diff) | |
| download | puppet-ac7efc8f0284d6b35f5428da06ba371cf94998ec.tar.gz puppet-ac7efc8f0284d6b35f5428da06ba371cf94998ec.tar.xz puppet-ac7efc8f0284d6b35f5428da06ba371cf94998ec.zip | |
Feature #2935 Puppet::Mode#master?
Use a predicate function on the Mode object instead of comparing with
the executable name everywhere
Signed-off-by: Jesse Wolfe <jes5199@gmail.com>
Diffstat (limited to 'lib/puppet/network')
| -rw-r--r-- | lib/puppet/network/authorization.rb | 3 | ||||
| -rw-r--r-- | lib/puppet/network/http/webrick.rb | 2 | ||||
| -rw-r--r-- | lib/puppet/network/http_server/webrick.rb | 2 |
3 files changed, 3 insertions, 4 deletions
diff --git a/lib/puppet/network/authorization.rb b/lib/puppet/network/authorization.rb index 9ea4bf69e..7a61ab9b9 100644 --- a/lib/puppet/network/authorization.rb +++ b/lib/puppet/network/authorization.rb @@ -34,8 +34,7 @@ module Puppet::Network return false end else - # This is a hack way of seeing if we're a config master. - if Puppet[:name] == "puppetmasterd" + if Puppet.mode.master? Puppet.debug "Allowing " + msg return true else diff --git a/lib/puppet/network/http/webrick.rb b/lib/puppet/network/http/webrick.rb index 1a3f5ddce..a97add0c0 100644 --- a/lib/puppet/network/http/webrick.rb +++ b/lib/puppet/network/http/webrick.rb @@ -70,7 +70,7 @@ class Puppet::Network::HTTP::WEBrick # Make sure the settings are all ready for us. Puppet.settings.use(:main, :ssl, Puppet[:name]) - if Puppet[:name] == "puppetmasterd" + if Puppet.mode.master? file = Puppet[:masterhttplog] else file = Puppet[:httplog] diff --git a/lib/puppet/network/http_server/webrick.rb b/lib/puppet/network/http_server/webrick.rb index 051a35234..aa930681b 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[:name] == "puppetmasterd" + if Puppet.mode.master? file = Puppet[:masterhttplog] else file = Puppet[:httplog] |
