diff options
author | Matthew Sackman <matthew@rabbitmq.com> | 2011-06-22 13:32:30 +0100 |
---|---|---|
committer | Matthew Sackman <matthew@rabbitmq.com> | 2011-06-22 13:32:30 +0100 |
commit | eb5db5fde98de1d996ac8fd09f8251c22aafd1d2 (patch) | |
tree | 91306fcebdbe8ebfbf8fb65a72c83855479c09b1 /src/rabbit_amqqueue.erl | |
parent | 1c26a00f593606c5af6b09ff16f7e74c05393fdd (diff) | |
download | rabbitmq-server-eb5db5fde98de1d996ac8fd09f8251c22aafd1d2.tar.gz |
Explode if the nodes policy has an empty list as the policy paramsbug23554
Diffstat (limited to 'src/rabbit_amqqueue.erl')
-rw-r--r-- | src/rabbit_amqqueue.erl | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/rabbit_amqqueue.erl b/src/rabbit_amqqueue.erl index 21e3721e..bacb1d21 100644 --- a/src/rabbit_amqqueue.erl +++ b/src/rabbit_amqqueue.erl @@ -252,7 +252,6 @@ determine_queue_nodes(Args) -> {{_Type, <<"nodes">>}, {array, Nodes}} -> case [list_to_atom(binary_to_list(Node)) || {longstr, Node} <- Nodes] of - [] -> {node(), undefined}; [Node] -> {Node, undefined}; [First | Rest] -> {First, Rest} end; @@ -357,12 +356,14 @@ check_ha_policy_argument({longstr, <<"nodes">>}, Args) -> case rabbit_misc:table_lookup(Args, <<"x-ha-policy-params">>) of undefined -> {error, {require, 'x-ha-policy-params'}}; + {array, []} -> + {error, {require_non_empty_list_of_nodes_for_ha}}; {array, Ary} -> case lists:all(fun ({longstr, _Node}) -> true; (_ ) -> false end, Ary) of - true -> ok; - false -> {error, {require_list_of_nodes_as_longstrs, Ary}} + true -> ok; + false -> {error, {require_node_list_as_longstrs_for_ha, Ary}} end; {Type, _} -> {error, {ha_nodes_policy_params_not_array_of_longstr, Type}} |