Puppet: System Administration Automated

Support

Ticket #484: unknown_config_vars_02.patch

File unknown_config_vars_02.patch, 1.1 kB (added by puppet, 2 years ago)

This patch should be correct. I belive the only possibilities for a config parameter at that point in the parser is that it's in metas, or @config.

  • config.rb

    old new  
    3939            param = symbolize(param) 
    4040            unless @config.include?(param) 
    4141                raise Puppet::Error, 
    42                     "Unknown configuration parameter %s" % param.inspect 
     42                    "Attempt to assign a value to unknown configuration parameter %s" % param.inspect 
    4343            end 
    4444            unless @order.include?(param) 
    4545                @order << param 
     
    283283                var = $1.intern 
    284284                value = mungearg($2) 
    285285 
     286                # JJM: Only warn if we don't know what this config var is. 
     287                #      This prevents exceptions later on. 
     288                unless @config.include?(var) or metas.include?(var.to_s) 
     289                    Puppet.warning "Discarded unknown configuration parameter %s" % var.inspect 
     290                    next # Skip this line. 
     291                end 
     292 
    286293                # Mmm, "special" attributes 
    287294                if metas.include?(var.to_s) 
    288295                    unless values.include?(section)