Class: Puppet::Network::AuthConfigLoader

Inherits:
Object
  • Object
show all
Defined in:
lib/puppet/network/authorization.rb

Class Method Summary collapse

Class Method Details

.authconfigObject

Create our config object if necessary. If there’s no configuration file we install our defaults



9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/puppet/network/authorization.rb', line 9

def self.authconfig
  @auth_config_file ||= Puppet::Util::WatchedFile.new(Puppet[:rest_authconfig])
  if (not @auth_config) or @auth_config_file.changed?
    begin
      @auth_config = Puppet::Network::AuthConfigParser.new_from_file(Puppet[:rest_authconfig]).parse
    rescue Errno::ENOENT, Errno::ENOTDIR
      @auth_config = Puppet::Network::AuthConfig.new
    end
  end

  @auth_config
end