mirror of
https://github.com/valitydev/riak_test.git
synced 2024-11-06 08:35:22 +00:00
Added checks for installed riak versions
This commit is contained in:
parent
3e5e850afe
commit
06b74f9291
@ -19,7 +19,6 @@ cli_options() ->
|
||||
|
||||
|
||||
main(Args) ->
|
||||
%% @todo Fail cleanly if version of riak unavailable (e.g. 0.14.2)
|
||||
%% @todo loaded_upgrade basho_bench polution
|
||||
{ok, {ParsedArgs, HarnessArgs}} = getopt:parse(cli_options(), Args),
|
||||
|
||||
|
@ -111,6 +111,9 @@ deploy_nodes(NodeConfig) ->
|
||||
NodeMap = orddict:from_list(lists:zip(Nodes, NodesN)),
|
||||
{Versions, Configs} = lists:unzip(NodeConfig),
|
||||
VersionMap = lists:zip(NodesN, Versions),
|
||||
|
||||
%% Check that you have the right versions available
|
||||
[ check_node(Version) || Version <- VersionMap ],
|
||||
rt:set_config(rt_nodes, NodeMap),
|
||||
rt:set_config(rt_versions, VersionMap),
|
||||
|
||||
@ -243,3 +246,11 @@ get_cmd_result(Port, Acc) ->
|
||||
after 0 ->
|
||||
timeout
|
||||
end.
|
||||
|
||||
check_node({_N, Version}) ->
|
||||
case proplists:is_defined(Version, rt:config(rtdev_path)) of
|
||||
true -> ok;
|
||||
_ ->
|
||||
lager:error("You don't have Riak ~s installed", [Version]),
|
||||
erlang:error("You don't have Riak " ++ Version ++ " installed" )
|
||||
end.
|
Loading…
Reference in New Issue
Block a user