diff options
Diffstat (limited to 'lib/puppet/network/authorization.rb')
-rw-r--r-- | lib/puppet/network/authorization.rb | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/lib/puppet/network/authorization.rb b/lib/puppet/network/authorization.rb index eb7690db4..d65aeeb6a 100644 --- a/lib/puppet/network/authorization.rb +++ b/lib/puppet/network/authorization.rb @@ -10,7 +10,7 @@ module Puppet::Network # Create our config object if necessary. This works even if # there's no configuration file. def authconfig - unless defined? @authconfig + unless defined?(@authconfig) @authconfig = Puppet::Network::AuthConfig.main() end @@ -20,9 +20,7 @@ module Puppet::Network # Verify that our client has access. We allow untrusted access to # puppetca methods but no others. def authorized?(request) - msg = "%s client %s access to %s" % - [request.authenticated? ? "authenticated" : "unauthenticated", - request, request.call] + msg = "%s client %s access to %s" % [request.authenticated? ? "authenticated" : "unauthenticated", request, request.call] if request.authenticated? if authconfig.exists? @@ -57,8 +55,7 @@ module Puppet::Network if handler_loaded?(request.handler) return true else - Puppet.warning "Client %s requested unavailable functionality %s" % - [request, request.handler] + Puppet.warning "Client %s requested unavailable functionality %s" % [request, request.handler] return false end end @@ -72,8 +69,7 @@ module Puppet::Network end unless authorized?(request) raise InvalidClientRequest.new( - "Host %s not authorized to call %s" % - [request, request.call] + "Host %s not authorized to call %s" % [request, request.call] ) end end |