Class: Puppet::Environments::StaticDirectory Private

Inherits:
Static show all
Defined in:
lib/puppet/environments.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Instance Method Summary collapse

Methods inherited from Static

#get, #list, #search_paths

Methods included from EnvironmentLoader

#clear_all, #get!, #guard, #unguard

Methods included from EnvironmentCreator

#for

Constructor Details

#initialize(env_name, env_dir, environment) ⇒ StaticDirectory

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Accepts a single environment in the given directory having the given name (not required to be reflected as the name of the directory)



149
150
151
152
153
# File 'lib/puppet/environments.rb', line 149

def initialize(env_name, env_dir, environment)
  super(environment)
  @env_dir = env_dir
  @env_name = env_name.intern
end

Instance Method Details

#get_conf(name) ⇒ Puppet::Setting::EnvironmentConf?

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Attempt to obtain the initial configuration for the environment. Not all loaders can provide this.

Parameters:

  • name (String, Symbol)

    The name of the environment whose configuration we are looking up

Returns:

  • (Puppet::Setting::EnvironmentConf, nil)

    the configuration for the requested environment, or nil if not found or no configuration is available



156
157
158
159
160
# File 'lib/puppet/environments.rb', line 156

def get_conf(name)
  return nil unless name.intern == @env_name

  Puppet::Settings::EnvironmentConf.load_from(@env_dir, [])
end