Use init:script_id() for the server version. #22

Merged
merged 1 commit into from Mar 1, 2013
View
5 src/riak_api_basic_pb_service.erl
@@ -57,21 +57,18 @@ init() ->
undefined.
%% @doc decode/2 callback. Decodes an incoming message.
-%% @todo Factor this out of riakc_pb to remove the dependency.
decode(Code, Bin) when Code == 1; Code == 7 ->
{ok, riak_pb_codec:decode(Code, Bin)}.
%% @doc encode/1 callback. Encodes an outgoing response message.
-%% @todo Factor this out of riakc_pb to remove the dependency.
encode(Message) ->
{ok, riak_pb_codec:encode(Message)}.
%% @doc process/2 callback. Handles an incoming request message.
process(rpbpingreq, State) ->
{reply, rpbpingresp, State};
process(rpbgetserverinforeq, State) ->
- %% TODO: Think of a better way to present the server version
- {ok, Vsn} = application:get_key(riak_kv, vsn),
+ {_, Vsn} = init:script_id(),
@russelldb
Basho Technologies member
russelldb added a line comment Mar 1, 2013

I notice on my current build application:get_key(riak_kv, vsn) and init:script_id() return different values. Is the former maintained by hand in the riak_kv.app.src? where does the init:script_id() value come from? (I mean, I see it comes from riak.rel / riak.boot in, but how does it get there, e.g. mine says 1.3.0rc2 but application:get_key says 1.3.0)

@seancribbs
seancribbs added a line comment Mar 1, 2013

It is set originally in reltool.config and ends up in the riak.rel file. The fact that your release still says 1.3.0rc2 is because of this line in reltool.config on master:

{sys, [
       {lib_dirs, ["../deps", "../deps/riak_search/apps"]},
       {rel, "riak", "1.3.0rc2",
       %...
@russelldb
Basho Technologies member
russelldb added a line comment Mar 1, 2013

ty

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Message = #rpbgetserverinforesp{node = riak_pb_codec:to_binary(node()),
server_version = riak_pb_codec:to_binary(Vsn)},
{reply, Message, State}.