summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlvaro Videla <videlalvaro@gmail.com>2015-10-27 11:41:13 +0100
committerAlvaro Videla <videlalvaro@gmail.com>2015-10-27 11:41:13 +0100
commit03b31b4da0f3bfe4010a56c592c118cb5f869c15 (patch)
tree07810c565bdadd68e5b7fbef71c8180f9f828c6f /src
parent79237dc7f827c182adfd79c51167253b929ba517 (diff)
downloadrabbitmq-server-git-03b31b4da0f3bfe4010a56c592c118cb5f869c15.tar.gz
cosmetics
Diffstat (limited to 'src')
-rw-r--r--src/rabbit_queue_location_validator.erl7
-rw-r--r--src/rabbit_queue_master_location_misc.erl35
2 files changed, 21 insertions, 21 deletions
diff --git a/src/rabbit_queue_location_validator.erl b/src/rabbit_queue_location_validator.erl
index 1260423d59..00bea44e29 100644
--- a/src/rabbit_queue_location_validator.erl
+++ b/src/rabbit_queue_location_validator.erl
@@ -36,8 +36,8 @@ validate_policy(KeyList) ->
validate_strategy(Strategy) ->
case module(Strategy) of
- R={ok, _M} -> R;
- _ ->
+ R = {ok, _M} -> R;
+ _ ->
{error, "~p invalid queue-master-locator value", [Strategy]}
end.
@@ -63,6 +63,7 @@ module(Strategy) when is_binary(Strategy) ->
non_existing -> no_location_strategy;
_ -> {ok, Module}
end;
- _ -> no_location_strategy
+ _ ->
+ no_location_strategy
end
end.
diff --git a/src/rabbit_queue_master_location_misc.erl b/src/rabbit_queue_master_location_misc.erl
index 0b5080956c..17f5512f95 100644
--- a/src/rabbit_queue_master_location_misc.erl
+++ b/src/rabbit_queue_master_location_misc.erl
@@ -30,7 +30,7 @@ lookup_master(QueueNameBin, VHostPath) when is_binary(QueueNameBin),
is_binary(VHostPath) ->
Queue = rabbit_misc:r(VHostPath, queue, QueueNameBin),
case rabbit_amqqueue:lookup(Queue) of
- {ok, #amqqueue{pid=Pid}} when is_pid(Pid) ->
+ {ok, #amqqueue{pid = Pid}} when is_pid(Pid) ->
{ok, node(Pid)};
Error -> Error
end.
@@ -45,16 +45,16 @@ lookup_queue(QueueNameBin, VHostPath) when is_binary(QueueNameBin),
get_location(Queue=#amqqueue{})->
Reply1 = case get_location_mod_by_args(Queue) of
- _Err1={error, _} ->
- case get_location_mod_by_policy(Queue) of
- _Err2={error, _} ->
- case get_location_mod_by_config(Queue) of
- Err3={error, _} -> Err3;
- Reply0={ok, _Module} -> Reply0
- end;
- Reply0={ok, _Module} -> Reply0
- end;
- Reply0={ok, _Module} -> Reply0
+ _Err1 = {error, _} ->
+ case get_location_mod_by_policy(Queue) of
+ _Err2 = {error, _} ->
+ case get_location_mod_by_config(Queue) of
+ Err3 = {error, _} -> Err3;
+ Reply0 = {ok, _Module} -> Reply0
+ end;
+ Reply0 = {ok, _Module} -> Reply0
+ end;
+ Reply0 = {ok, _Module} -> Reply0
end,
case Reply1 of
@@ -66,8 +66,8 @@ get_location_mod_by_args(#amqqueue{arguments=Args}) ->
case proplists:lookup(<<"x-queue-master-locator">> , Args) of
{<<"x-queue-master-locator">> , Strategy} ->
case rabbit_queue_location_validator:validate_strategy(Strategy) of
- Reply={ok, _CB} -> Reply;
- Error -> Error
+ Reply = {ok, _CB} -> Reply;
+ Error -> Error
end;
_ -> {error, "x-queue-master-locator undefined"}
end.
@@ -77,8 +77,8 @@ get_location_mod_by_policy(Queue=#amqqueue{}) ->
undefined -> {error, "queue-master-locator policy undefined"};
Strategy ->
case rabbit_queue_location_validator:validate_strategy(Strategy) of
- Reply={ok, _CB} -> Reply;
- Error -> Error
+ Reply = {ok, _CB} -> Reply;
+ Error -> Error
end
end.
@@ -86,11 +86,10 @@ get_location_mod_by_config(#amqqueue{}) ->
case application:get_env(rabbit, queue_master_locator) of
{ok, Strategy} ->
case rabbit_queue_location_validator:validate_strategy(Strategy) of
- Reply={ok, _CB} -> Reply;
- Error -> Error
+ Reply = {ok, _CB} -> Reply;
+ Error -> Error
end;
_ -> {error, "queue_master_locator undefined"}
end.
all_nodes() -> rabbit_mnesia:cluster_nodes(running).
-