inliniac/suricata — pull request #662 by jasonish (2013-11-27 15:53:45+00:00)
Title: Configuration value overrides - v2.

Supercedes PR #652.

First some configuration API cleanup to make its usage more concise.

Then parsing the configuration file and a top level
key that already exists is redefined, override it. The exception
is for final type values, we don't want to override them as they
may have been set on the command line, which means they should
take precedence. There are other ways to go about this, but this
seemed pretty straight forward (to me anyways).

This does change the current behaviour (while undefined) of merging values together, but matches the behaviour of other higher level YAML parsers. The YAML spec does not specify behaviour for duplicate keys other than it is an error. So its somewhat left up to the parser.

My opinion is that we should choose the default behaviour, merge or replace, and then if a need is found for the other behaviour we introduce it through a keyword or !tag.