472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
|
# File 'lib/vendor/puppet/util/settings.rb', line 472
def set_value(param, value, type, options = {})
param = param.to_sym
unless setting = @config[param]
if options[:ignore_bad_settings]
return
else
raise ArgumentError,
"Attempt to assign a value to unknown configuration parameter #{param.inspect}"
end
end
value = setting.munge(value) if setting.respond_to?(:munge)
setting.handle(value) if setting.respond_to?(:handle) and not options[:dont_trigger_handles]
if ReadOnly.include? param and type != :mutable_defaults
raise ArgumentError,
"You're attempting to set configuration parameter $#{param}, which is read-only."
end
type = legacy_to_mode(type, param)
@sync.synchronize do
setting.setbycli = true if type == :cli
@values[type][param] = value
@cache.clear
clearused
Puppet::Node::Environment.clear if defined?(Puppet::Node) and defined?(Puppet::Node::Environment)
end
value
end
|