Implement smarter merge mechanism #56
Closed
Labels
Comments
nemesisdesign
added a commit
that referenced
this issue
Jan 16, 2017
nemesisdesign
added a commit
that referenced
this issue
Jan 16, 2017
The implementation introduced in f91b7b5 seems good enough. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When two lists are merged with
netjsonconfig.utils.merge_config
, the result is the sum of the elements contained in the two lists.However, often these lists are list of dictionaries representing interfaces and radios, and with the current implementation it is not possible to override the value of one of the dicts, this is best explained with an example.
We have a template in which
radio0
hastx_power
set to20
:And a configuration object in which
radio0
hastx_power
set to10
(much lower than what's set intemplate
):When we merge the two:
result
will look like the following:But what we want is:
That is, we want to be able to override specifc attributes of dictionaries contained in lists.
The text was updated successfully, but these errors were encountered: