Skip to content

Commit

Permalink
Merge branch 'release/0.4.7'
Browse files Browse the repository at this point in the history
  • Loading branch information
yosukehara committed May 21, 2015
2 parents 2eccd69 + 1f0261b commit 23306e9
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 20 deletions.
2 changes: 1 addition & 1 deletion rebar.config
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
{require_otp_vsn, "R16B*|17"}.

{deps, [
{savanna_commons, ".*", {git, "https://github.com/leo-project/savanna_commons.git", {tag, "0.8.8"}}}
{savanna_commons, ".*", {git, "https://github.com/leo-project/savanna_commons.git", {tag, "0.8.10"}}}
]}.

{erl_opts, [{d, 'NOTEST'},
Expand Down
2 changes: 1 addition & 1 deletion src/savanna_agent.app.src
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
{application, savanna_agent,
[
{description, "Savanna Agent"},
{vsn, "0.4.6"},
{vsn, "0.4.7"},
{registered, []},
{applications, [
kernel,
Expand Down
6 changes: 3 additions & 3 deletions src/savanna_agent.erl
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@
start(MnesiaDiscType) ->
_ = mnesia:start(),
Nodes = [erlang:node()],
{atomic,ok} = svc_tbl_schema:create_table(MnesiaDiscType, Nodes),
{atomic,ok} = svc_tbl_column:create_table(MnesiaDiscType, Nodes),
{atomic,ok} = svc_tbl_metric_group:create_table(MnesiaDiscType, Nodes),
ok = svc_tbl_schema:create_table(MnesiaDiscType, Nodes),
ok = svc_tbl_column:create_table(MnesiaDiscType, Nodes),
ok = svc_tbl_metric_group:create_table(MnesiaDiscType, Nodes),
application:start(savanna_agent).


Expand Down
35 changes: 21 additions & 14 deletions src/savanna_agent_tbl_members.erl
Original file line number Diff line number Diff line change
Expand Up @@ -45,20 +45,27 @@
-spec(create_table(disc_copies|ram_copies, [atom()]) ->
{atomic, ok} | {aborted, any()}).
create_table(Mode, Nodes) ->
mnesia:create_table(
?TBL_NAME,
[{Mode, Nodes},
{type, set},
{record_name, member},
{attributes, record_info(fields, member)},
{user_properties,
[
{node, atom, primary},
{ip, string, false },
{port, pos_integer, false },
{state, atom, false }
]}
]).
case mnesia:create_table(
?TBL_NAME,
[{Mode, Nodes},
{type, set},
{record_name, member},
{attributes, record_info(fields, member)},
{user_properties,
[
{node, atom, primary},
{ip, string, false },
{port, pos_integer, false },
{state, atom, false }
]}
]) of
{atomic, ok} ->
ok;
{aborted,{already_exists,_}} ->
ok;
{aborted,Error} ->
{error, Error}
end.


%% @doc Retrieve all records
Expand Down
2 changes: 1 addition & 1 deletion test/savanna_agent_tbl_members_test.erl
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ suite_test_() ->


suite() ->
{atomic, ok} = savanna_agent_tbl_members:create_table(ram_copies, [node()]),
ok = savanna_agent_tbl_members:create_table(ram_copies, [node()]),
not_found = savanna_agent_tbl_members:all(),
not_found = savanna_agent_tbl_members:get(node()),

Expand Down

0 comments on commit 23306e9

Please sign in to comment.