# File lib/puppet/util/settings.rb, line 480
480:   def set_value(param, value, type, options = {})
481:     param = param.to_sym
482:     unless setting = @config[param]
483:       if options[:ignore_bad_settings]
484:         return
485:       else
486:         raise ArgumentError,
487:           "Attempt to assign a value to unknown configuration parameter #{param.inspect}"
488:       end
489:     end
490:     value = setting.munge(value) if setting.respond_to?(:munge)
491:     setting.handle(value) if setting.respond_to?(:handle) and not options[:dont_trigger_handles]
492:     if ReadOnly.include? param and type != :mutable_defaults
493:       raise ArgumentError,
494:         "You're attempting to set configuration parameter $#{param}, which is read-only."
495:     end
496:     type = legacy_to_mode(type, param)
497:     @sync.synchronize do # yay, thread-safe
498:       @values[type][param] = value
499:       @cache.clear
500: 
501:       clearused
502: 
503:       # Clear the list of environments, because they cache, at least, the module path.
504:       # We *could* preferentially just clear them if the modulepath is changed,
505:       # but we don't really know if, say, the vardir is changed and the modulepath
506:       # is defined relative to it. We need the defined?(stuff) because of loading
507:       # order issues.
508:       Puppet::Node::Environment.clear if defined?(Puppet::Node) and defined?(Puppet::Node::Environment)
509:     end
510: 
511:     value
512:   end