# File lib/puppet/util/settings.rb, line 308
308:   def unsafe_parse(file)
309:     return unless FileTest.exist?(file)
310:     begin
311:       data = parse_file(file)
312:     rescue => details
313:       puts details.backtrace if Puppet[:trace]
314:       Puppet.err "Could not parse #{file}: #{details}"
315:       return
316:     end
317: 
318:     unsafe_clear(true)
319: 
320:     metas = {}
321:     data.each do |area, values|
322:       metas[area] = values.delete(:_meta)
323:       values.each do |key,value|
324:         set_value(key, value, area, :dont_trigger_handles => true, :ignore_bad_settings => true )
325:       end
326:     end
327: 
328:     # Determine our environment, if we have one.
329:     if @config[:environment]
330:       env = self.value(:environment).to_sym
331:     else
332:       env = "none"
333:     end
334: 
335:     # Call any hooks we should be calling.
336:     settings_with_hooks.each do |setting|
337:       each_source(env) do |source|
338:         if value = @values[source][setting.name]
339:           # We still have to use value to retrieve the value, since
340:           # we want the fully interpolated value, not $vardir/lib or whatever.
341:           # This results in extra work, but so few of the settings
342:           # will have associated hooks that it ends up being less work this
343:           # way overall.
344:           setting.handle(self.value(setting.name, env))
345:           break
346:         end
347:       end
348:     end
349: 
350:     # We have to do it in the reverse of the search path,
351:     # because multiple sections could set the same value
352:     # and I'm too lazy to only set the metadata once.
353:     searchpath.reverse.each do |source|
354:       source = run_mode if source == :run_mode
355:       source = @name if (@name && source == :name)
356:       if meta = metas[source]
357:         set_metadata(meta)
358:       end
359:     end
360:   end