diff options
author | Matthew Sackman <matthew@rabbitmq.com> | 2011-03-17 16:53:15 +0000 |
---|---|---|
committer | Matthew Sackman <matthew@rabbitmq.com> | 2011-03-17 16:53:15 +0000 |
commit | b13bd327e6d58bfe4fdeb8f8c14f666f493fbe54 (patch) | |
tree | 15f877d88b001007a17a5a09b7f577dc9bb738e3 /src | |
parent | 544081a948a2ecc2e114dfb81aaf268cf10d966d (diff) | |
download | rabbitmq-server-b13bd327e6d58bfe4fdeb8f8c14f666f493fbe54.tar.gz |
Can't call =~= with non-version args, thus shuffle things around a bit. End up saving a line.
Diffstat (limited to 'src')
-rw-r--r-- | src/rabbit_upgrade.erl | 33 |
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. |