diff options
| author | Simon MacMullen <simon@rabbitmq.com> | 2011-11-07 12:16:13 +0000 |
|---|---|---|
| committer | Simon MacMullen <simon@rabbitmq.com> | 2011-11-07 12:16:13 +0000 |
| commit | 6c5e554fc596ef3149a32a7e9335117d58b125a0 (patch) | |
| tree | 6a497cdcedfcf915d1f898203d0e308785aa67e7 | |
| parent | c60fdf21357804931761fa154c803259dcdf20c6 (diff) | |
| download | rabbitmq-server-git-6c5e554fc596ef3149a32a7e9335117d58b125a0.tar.gz | |
Big ugly warning.
| -rw-r--r-- | src/rabbit_plugins.erl | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/src/rabbit_plugins.erl b/src/rabbit_plugins.erl index b06bcd8333..0862f1b2c7 100644 --- a/src/rabbit_plugins.erl +++ b/src/rabbit_plugins.erl @@ -105,11 +105,11 @@ action(enable, ToEnable0, _Opts, PluginsFile, PluginsDir) -> end, NewEnabled = lists:usort(Enabled ++ ToEnable), write_enabled_plugins(PluginsFile, NewEnabled), + NewImplicitlyEnabled = calculate_required_plugins(NewEnabled, AllPlugins), + maybe_warn_mochiweb(NewImplicitlyEnabled), case NewEnabled -- ImplicitlyEnabled of [] -> io:format("Plugin configuration unchanged.~n"); - _ -> NewImplicitlyEnabled = - calculate_required_plugins(NewEnabled, AllPlugins), - print_list("The following plugins have been enabled:", + _ -> print_list("The following plugins have been enabled:", NewImplicitlyEnabled -- ImplicitlyEnabled), io:format("Plugin configuration has changed. " "Restart RabbitMQ for changes to take effect.~n") @@ -355,3 +355,22 @@ calculate_dependencies(Reverse, Sources, AllPlugins) -> end, true = digraph:delete(G), Dests. + +maybe_warn_mochiweb(Enabled) -> + V = erlang:system_info(otp_release), + case lists:member(mochiweb, Enabled) andalso V < "R13B01" of + true -> + Stars = string:copies("*", 80), + io:format("~n~n~s~n" + " Warning: Mochiweb enabled and Erlang version ~s " + "detected.~n" + " Enabling plugins that depend on Mochiweb is not " + "supported on this Erlang~n" + " version. At least R13B01 is required.~n~n" + " RabbitMQ will not start successfully in this " + "configuration. You *must*~n" + " disable the Mochiweb plugin, or upgrade Erlang.~n" + "~s~n~n~n", [Stars, V, Stars]); + false -> + ok + end. |
