summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/rabbit_upgrade.erl33
1 files changed, 16 insertions, 17 deletions
diff --git a/src/rabbit_upgrade.erl b/src/rabbit_upgrade.erl
index 20f53da2..875d971a 100644
--- a/src/rabbit_upgrade.erl
+++ b/src/rabbit_upgrade.erl
@@ -139,24 +139,23 @@ upgrade_mode(AllNodes) ->
[])
end;
[Another|_] ->
- ClusterVersion =
- case rpc:call(Another, rabbit_version, desired_for_scope,
- [mnesia]) of
- {badrpc, {'EXIT', {undef, _}}} -> unknown_old_version;
- {badrpc, Reason} -> {unknown, Reason};
- V -> V
- end,
MyVersion = rabbit_version:desired_for_scope(mnesia),
- case rabbit_version:'=~='(ClusterVersion, MyVersion) of
- true ->
- %% The other node(s) have upgraded already, I am not the
- %% upgrader
- secondary;
- false ->
- %% The other node(s) are running an unexpected version.
- die("Cluster upgrade needed but other nodes are "
- "running ~p~nand I want ~p",
- [ClusterVersion, MyVersion])
+ ErrFun = fun (ClusterVersion) ->
+ %% The other node(s) are running an
+ %% unexpected version.
+ die("Cluster upgrade needed but other nodes are "
+ "running ~p~nand I want ~p",
+ [ClusterVersion, MyVersion])
+ end,
+ case rpc:call(Another, rabbit_version, desired_for_scope,
+ [mnesia]) of
+ {badrpc, {'EXIT', {undef, _}}} -> ErrFun(unknown_old_version);
+ {badrpc, Reason} -> ErrFun({unknown, Reason});
+ CV -> case rabbit_version:'=~='(
+ MyVersion, CV) of
+ true -> secondary;
+ false -> ErrFun(CV)
+ end
end
end.