diff options
-rw-r--r-- | lib/snmp/src/agent/snmpa_mib_storage_mnesia.erl | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/snmp/src/agent/snmpa_mib_storage_mnesia.erl b/lib/snmp/src/agent/snmpa_mib_storage_mnesia.erl index a1f2be9af3..dca44d3c33 100644 --- a/lib/snmp/src/agent/snmpa_mib_storage_mnesia.erl +++ b/lib/snmp/src/agent/snmpa_mib_storage_mnesia.erl @@ -64,11 +64,13 @@ open(Name, RecName, Fields, Type, Opts) -> ?vtrace("open ~p table ~p for record ~p", [Type, Name, RecName]), Action = snmp_misc:get_option(action, Opts, keep), - Nodes = snmp_misc:get_option(nodes, Opts, [node()]), + Nodes = snmp_misc:get_option(nodes, Opts, erlang:nodes()), case table_exists(Name) of true when (Action =:= keep) -> + ?vtrace("open table ~p - exist (keep)", [Name]), {ok, #tab{id = Name}}; true when (Action =:= clear) -> + ?vtrace("open table ~p - exist (clear)", [Name]), F = fun() -> mnesia:clear_table(Name) end, case mnesia:transaction(F) of {aborted, Reason} -> @@ -77,14 +79,18 @@ open(Name, RecName, Fields, Type, Opts) -> {ok, #tab{id = Name}} end; false -> + ?vtrace("open table ~p - does not exist", [Name]), Args = [{record_name, RecName}, {attributes, Fields}, {type, Type}, {disc_copies, Nodes}], case mnesia:create_table(Name, Args) of {atomic, ok} -> + ?vtrace("open table ~p - ok", [Name]), {ok, #tab{id = Name}}; {aborted, Reason} -> + ?vinfo("open table ~p - aborted" + "~n Reason: ~p", [Name, Reason]), {error, {create, Reason}} end end. |