diff options
| author | Matthias Radestock <matthias@rabbitmq.com> | 2012-10-25 16:35:23 +0100 |
|---|---|---|
| committer | Matthias Radestock <matthias@rabbitmq.com> | 2012-10-25 16:35:23 +0100 |
| commit | f76b2cbda309680e0af73ce192b8f321dddc9337 (patch) | |
| tree | c93358c710ffa79511e610d6fe750bd50f8c004b /src | |
| parent | 97464ec933e5fec86bd7294d32c4cb7712328cdf (diff) | |
| download | rabbitmq-server-git-f76b2cbda309680e0af73ce192b8f321dddc9337.tar.gz | |
betterness
- remove debug logging
- actually log something - rabbit_log isn't operation at this point
during startup so we need to use the plain error logger
- be less clever about config format checking - if it vaguely looks
like a legacy config then assume that, otherwise assume it's a new
style config.
- be more helpful in the warning message
Diffstat (limited to 'src')
| -rw-r--r-- | src/rabbit_mnesia.erl | 34 |
1 files changed, 14 insertions, 20 deletions
diff --git a/src/rabbit_mnesia.erl b/src/rabbit_mnesia.erl index 6fed391aa5..756fbe3b02 100644 --- a/src/rabbit_mnesia.erl +++ b/src/rabbit_mnesia.erl @@ -110,25 +110,22 @@ init() -> init_from_config() -> {TryNodes, NodeType} = case application:get_env(rabbit, cluster_nodes) of - {ok, {Nodes, disc} = C} when is_list(Nodes) -> - C; - {ok, {Nodes, ram } = C} when is_list(Nodes) -> - C; {ok, Nodes} when is_list(Nodes) -> - rabbit_log:info("blahblah ~p~n", [Nodes]), - %% Legacy config - rabbit_log:warning( - "Legacy 'cluster_nodes' configuration, use " + Config = {Nodes -- [node()], case lists:member(node(), Nodes) of + true -> disc; + false -> ram + end}, + error_logger:warning_msg( + "Converting legacy 'cluster_nodes' configuration~n ~w~n" + "to~n ~w.~n~n" + "Please update the configuration to the new format " "{Nodes, NodeType}, where Nodes contains the nodes that the " "node will try to cluster with, and NodeType is either " - "'disc' or 'ram'."), - {Nodes -- [node()], case lists:member(node(), Nodes) of - true -> disc; - false -> ram - end}; - _ -> - e(invalid_cluster_config) - end, + "'disc' or 'ram'~n", [Nodes, Config]), + Config; + {ok, Config} -> + Config + end, case find_good_node(nodes_excl_me(TryNodes)) of {ok, Node} -> rabbit_log:info("Node '~p' selected for clustering from " @@ -862,7 +859,4 @@ error_description(removing_node_from_offline_node) -> "To remove a node remotely from an offline node, the node you're removing " "from must be a disc node and all the other nodes must be offline."; error_description(no_running_cluster_nodes) -> - "You cannot leave a cluster if no online nodes are present."; -error_description(invalid_cluster_config) -> - "Invalid or missing cluster configuration. Check the 'cluster_nodes' field " - "in your config file.". + "You cannot leave a cluster if no online nodes are present.". |
