Class: Puppet::Environments::Legacy Private
- Includes:
- EnvironmentCreator
- Defined in:
- lib/puppet/environments.rb
Overview
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.
Old-style environments that come either from explicit stanzas in puppet.conf or from dynamic environments created from use of ‘$environment` in puppet.conf.
Instance Method Summary collapse
-
#get(name) ⇒ Puppet::Node::Environment?
private
Find a named environment.
-
#get!(name) ⇒ Puppet::Node::Environment
private
Find a named environment or raise Puppet::Environments::EnvironmentNotFound when the named environment is does not exist.
-
#get_conf(name) ⇒ Puppet::Setting::EnvironmentConf?
private
Attempt to obtain the initial configuration for the environment.
-
#list ⇒ Array<Puppet::Node::Environment>
private
All of the environments known to the loader.
-
#search_paths ⇒ Array<String>
private
A list of indicators of where the loader is getting its environments from.
Methods included from EnvironmentCreator
Instance Method Details
#get(name) ⇒ Puppet::Node::Environment?
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.
Because the Legacy system cannot list out all of its environments, get is able to return environments that are not returned by a call to #list.
Find a named environment
167 168 169 |
# File 'lib/puppet/environments.rb', line 167 def get(name) Puppet::Node::Environment.new(name) end |
#get!(name) ⇒ Puppet::Node::Environment
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.
Because the Legacy system cannot list out all of its environments, this method will never fail and is only calling get directly.
Find a named environment or raise Puppet::Environments::EnvironmentNotFound when the named environment is does not exist.
175 176 177 |
# File 'lib/puppet/environments.rb', line 175 def get!(name) get(name) end |
#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.
we could return something here, but since legacy environments are deprecated, there is no point.
Attempt to obtain the initial configuration for the environment. Not all loaders can provide this.
183 184 185 |
# File 'lib/puppet/environments.rb', line 183 def get_conf(name) nil end |
#list ⇒ Array<Puppet::Node::Environment>
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.
The list of environments for the Legacy environments is always empty.
Returns All of the environments known to the loader.
158 159 160 |
# File 'lib/puppet/environments.rb', line 158 def list [] end |
#search_paths ⇒ Array<String>
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.
A list of indicators of where the loader is getting its environments from.
150 151 152 |
# File 'lib/puppet/environments.rb', line 150 def search_paths ["file://#{Puppet[:config]}"] end |