summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrancesco Mazzoli <francesco@rabbitmq.com>2012-07-09 12:00:03 +0100
committerFrancesco Mazzoli <francesco@rabbitmq.com>2012-07-09 12:00:03 +0100
commita79eaecce2c3f28e465c957f8d7c8bc53295aa9d (patch)
treecd646554ddb348633fa2b237d40b089243db0df2
parent8100cd3899c1b9105f1b8c7c055f32de5daef910 (diff)
downloadrabbitmq-server-a79eaecce2c3f28e465c957f8d7c8bc53295aa9d.tar.gz
get rid of `is_disc_node'
-rw-r--r--src/rabbit_mnesia.erl14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/rabbit_mnesia.erl b/src/rabbit_mnesia.erl
index f263c576..d82fae92 100644
--- a/src/rabbit_mnesia.erl
+++ b/src/rabbit_mnesia.erl
@@ -147,7 +147,7 @@ init() ->
%% same cluster, we simply pick the first online node and we cluster to its
%% cluster.
join_cluster(DiscoveryNode, WantDiscNode) ->
- case is_disc_and_clustered() andalso is_only_disc_node(node()) of
+ case is_disc_and_clustered() andalso [node()] =:= clustered_disc_nodes() of
true -> throw({error,
{standalone_ram_node,
"You can't cluster a node if it's the only "
@@ -210,7 +210,9 @@ reset(Force) ->
%% Force=true here so that reset still works when clustered with a
%% node which is down.
init_db_with_mnesia(AllNodes, is_disc_node(), false, true),
- case is_disc_and_clustered() andalso is_only_disc_node(node()) of
+ case is_disc_and_clustered() andalso
+ [node()] =:= clustered_disc_nodes()
+ of
true -> throw({error, {standalone_ram_node,
"You can't reset a node if it's the "
"only disc node in a cluster. Please "
@@ -257,7 +259,7 @@ change_node_type(Type) ->
ram -> false;
disc -> true
end,
- case not WantDiscNode andalso is_only_disc_node(node(), DiscNodes) of
+ case not WantDiscNode andalso [node()] =:= DiscNodes of
true -> throw({error,
{standalone_ram_node,
"You can't change the node type to ram if the node is "
@@ -1078,12 +1080,6 @@ wait_for(Condition) ->
error_logger:info_msg("Waiting for ~p...~n", [Condition]),
timer:sleep(1000).
-is_only_disc_node(Node, DiscNodes) ->
- [Node] =:= DiscNodes.
-
-is_only_disc_node(Node) ->
- is_only_disc_node(Node, clustered_disc_nodes()).
-
start_mnesia(CheckConsistency) ->
case CheckConsistency of
true -> check_cluster_consistency();