Class: R10K::Source::Yaml
Constant Summary
Constants included from Logging
Logging::LOG_LEVELS, Logging::SYSLOG_LEVELS_MAP
Instance Attribute Summary
Attributes inherited from Base
#basedir, #name, #prefix, #puppetfile_name
Instance Method Summary collapse
-
#initialize(name, basedir, options = {}) ⇒ Yaml
constructor
A new instance of Yaml.
Methods inherited from Hash
#desired_contents, #environments, #environments_hash, #set_environments_hash, valid_environments_hash?
Methods inherited from Base
#accept, #environments, #preload!, #reload!
Methods included from Logging
add_outputters, debug_formatter, default_formatter, default_outputter, #logger, #logger_name, parse_level
Constructor Details
#initialize(name, basedir, options = {}) ⇒ Yaml
Returns a new instance of Yaml.
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/r10k/source/yaml.rb', line 4 def initialize(name, basedir, = {}) config = [:config] || '/etc/puppetlabs/r10k/environments.yaml' begin contents = ::YAML.load_file(config) rescue => e raise R10K::ConfigError, _("Couldn't open environments file %{file}: %{err}") % {file: config, err: e.} end # Set the environments key for the parent class to consume [:environments] = contents # All we need to do is supply options with the :environments hash. # The R10K::Source::Hash parent class takes care of the rest. super(name, basedir, ) end |