summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon MacMullen <simon@rabbitmq.com>2011-08-16 16:30:31 +0100
committerSimon MacMullen <simon@rabbitmq.com>2011-08-16 16:30:31 +0100
commit3523bdaa20c369496765c1ce4bafefef53e527fe (patch)
tree9e291fcd14100a124c92f328319ff2e7642dc6c0
parentfffc5d1545f68b40a89e4fd68989e0768d134fa9 (diff)
downloadrabbitmq-server-git-3523bdaa20c369496765c1ce4bafefef53e527fe.tar.gz
Don't have misc depend on mnesia.
-rw-r--r--src/rabbit_channel.erl3
-rw-r--r--src/rabbit_direct.erl3
-rw-r--r--src/rabbit_misc.erl8
-rw-r--r--src/rabbit_networking.erl3
4 files changed, 10 insertions, 7 deletions
diff --git a/src/rabbit_channel.erl b/src/rabbit_channel.erl
index 1193754823..93bff62b86 100644
--- a/src/rabbit_channel.erl
+++ b/src/rabbit_channel.erl
@@ -133,7 +133,8 @@ confirm(Pid, MsgSeqNos) ->
gen_server2:cast(Pid, {confirm, MsgSeqNos, self()}).
list() ->
- rabbit_misc:append_rpc_all_nodes(rabbit_channel, list_local, []).
+ rabbit_misc:append_rpc_all_nodes(rabbit_mnesia:running_clustered_nodes(),
+ rabbit_channel, list_local, []).
list_local() ->
pg_local:get_members(rabbit_channels).
diff --git a/src/rabbit_direct.erl b/src/rabbit_direct.erl
index 6d06d14643..9c42552a43 100644
--- a/src/rabbit_direct.erl
+++ b/src/rabbit_direct.erl
@@ -63,7 +63,8 @@ list_local() ->
pg_local:get_members(rabbit_direct).
list() ->
- rabbit_misc:append_rpc_all_nodes(rabbit_direct, list_local, []).
+ rabbit_misc:append_rpc_all_nodes(rabbit_mnesia:running_clustered_nodes(),
+ rabbit_direct, list_local, []).
%%----------------------------------------------------------------------------
diff --git a/src/rabbit_misc.erl b/src/rabbit_misc.erl
index 893fc19150..ae28722ab2 100644
--- a/src/rabbit_misc.erl
+++ b/src/rabbit_misc.erl
@@ -58,7 +58,7 @@
-export([is_process_alive/1]).
-export([pget/2, pget/3, pget_or_die/2]).
-export([format_message_queue/2]).
--export([append_rpc_all_nodes/3]).
+-export([append_rpc_all_nodes/4]).
%%----------------------------------------------------------------------------
@@ -209,7 +209,7 @@
-spec(pget/3 :: (term(), [term()], term()) -> term()).
-spec(pget_or_die/2 :: (term(), [term()]) -> term() | no_return()).
-spec(format_message_queue/2 :: (any(), priority_queue:q()) -> term()).
--spec(append_rpc_all_nodes/3 :: (atom(), atom(), [any()]) -> [any()]).
+-spec(append_rpc_all_nodes/4 :: ([node()], atom(), atom(), [any()]) -> [any()]).
-endif.
@@ -957,8 +957,8 @@ format_message_queue_entry(V) when is_tuple(V) ->
format_message_queue_entry(_V) ->
'_'.
-append_rpc_all_nodes(M, F, A) ->
- {ResL, _} = rpc:multicall(rabbit_mnesia:running_clustered_nodes(), M, F, A),
+append_rpc_all_nodes(Nodes, M, F, A) ->
+ {ResL, _} = rpc:multicall(Nodes, M, F, A),
lists:append([case Res of
{badrpc, _} -> [];
_ -> Res
diff --git a/src/rabbit_networking.erl b/src/rabbit_networking.erl
index 79dd084745..b2abcba651 100644
--- a/src/rabbit_networking.erl
+++ b/src/rabbit_networking.erl
@@ -276,7 +276,8 @@ start_ssl_client(SslOpts, Sock) ->
start_client(Sock, ssl_transform_fun(SslOpts)).
connections() ->
- rabbit_misc:append_rpc_all_nodes(rabbit_networking, connections_local, []).
+ rabbit_misc:append_rpc_all_nodes(rabbit_mnesia:running_clustered_nodes(),
+ rabbit_networking, connections_local, []).
connections_local() ->
[rabbit_connection_sup:reader(ConnSup) ||