596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
|
# File 'lib/puppet/settings.rb', line 596
def parse_config(text, file = "text")
begin
data = @config_file_parser.parse_file(file, text, ALLOWED_SECTION_NAMES)
rescue => detail
Puppet.log_exception(detail, "Could not parse #{file}: #{detail}")
return
end
return if data.nil?
unsafe_clear(false, false)
screen_non_puppet_conf_settings(data)
record_deprecations_from_puppet_conf(data)
@configuration_file = data
if @config[:environment]
env = value(:environment).to_sym
else
env = NONE
end
value_sets = value_sets_for(env, preferred_run_mode)
@config.values.select(&:has_hook?).each do |setting|
value_sets.each do |source|
next unless source.include?(setting.name)
if setting.call_hook_on_initialize?
@hooks_to_call_on_application_initialization |= [setting]
else
setting.handle(ChainedValues.new(
preferred_run_mode,
env,
value_sets,
@config
).interpolate(setting.name))
end
break
end
end
call_hooks_deferred_to_application_initialization :ignore_interpolation_dependency_errors => true
apply_metadata
end
|