Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add simple escript to modify advanced.config.
In the future we should fix the tests to actually use a non-test backend configuration properly, but for now we can apply our customization directly to the advanced.config file, even against riak_ee which will ship with settings already in advanced.config.
- Loading branch information
1 parent
916d5a1
commit 4e8b7ad
Showing
2 changed files
with
12 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/usr/bin/env escript | ||
%% -*- erlang -*- | ||
main([File|Additions]) -> | ||
{ok, Settings} = file:consult(File), | ||
Terms = [ begin | ||
{ok, Tokens, _} = erl_scan:string(String), | ||
{ok, Term} = erl_parse:parse_term(Tokens), | ||
Term | ||
end || String <- Additions ], | ||
Merged = lists:flatten(Terms++Settings), | ||
file:write_file(File, io_lib:format("~p.",[Merged])). |
4e8b7ad
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Based on my testing, this doesn't handle the case where
riak_kv
already exists inadvanced.config
.4e8b7ad
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Specifically, it creates 2 distinct
riak_kv
sections instead of merging them.4e8b7ad
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I'm aware, but for the sake of the builder it doesn't matter because the node is thrown away and rebuilt on each run.
4e8b7ad
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure my email did anything, so: does it work? Will Riak merge the configuration blocks at launch and recognize all of the
riak_kv
settings?4e8b7ad
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Look at the build output, it works. 😄