class Puppet::Network::AuthConfigLoader

Public Class Methods

authconfig() click to toggle source

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

# File lib/puppet/network/authorization.rb, line 9
def self.authconfig
  @auth_config_file ||= Puppet::Util::LoadedFile.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