diff options
author | Jean-Sebastien Pedron <jean-sebastien@rabbitmq.com> | 2014-11-26 18:21:44 +0100 |
---|---|---|
committer | Jean-Sebastien Pedron <jean-sebastien@rabbitmq.com> | 2014-11-26 18:21:44 +0100 |
commit | f8466d59675c57c89935c7b2466d7e3177440f40 (patch) | |
tree | af2723a1edc4e8f27879133970493c510679c4dc | |
parent | 5f4b08236c8806d3fd2d56f0f11ddc8309b6e506 (diff) | |
download | rabbitmq-server-f8466d59675c57c89935c7b2466d7e3177440f40.tar.gz |
Only check ERTS version to determine if we accept an external eldap
-rw-r--r-- | src/rabbit_plugins.erl | 34 |
1 files changed, 3 insertions, 31 deletions
diff --git a/src/rabbit_plugins.erl b/src/rabbit_plugins.erl index fe614b6a..fd6acb5c 100644 --- a/src/rabbit_plugins.erl +++ b/src/rabbit_plugins.erl @@ -148,37 +148,9 @@ keep_plugin(#plugin{name = App} = Plugin) -> end. plugin_provided_by_otp(#plugin{name = eldap, version = PluginVsn}) -> - %% eldap was added to Erlang/OTP R15B01. We prefer this version - %% to the plugin. Before, eldap always advertised version "1". In - %% R15B01, it got proper versionning starting from "1.0". If eldap's - %% version is "1", we keep using the plugin, otherwise we take the - %% OTP application. As an extra check, we look at ERTS version to be - %% sure we're on R15B01. - case application:get_key(eldap, vsn) of - {ok, PluginVsn} -> - %% The plugin itself; the plugin was previously added to the - %% code path. - false; - {ok, "1"} -> - %% The version available on GitHub, not part of OTP. - false; - {ok, Vsn} -> - try rabbit_misc:version_compare(Vsn, "1.0", gte) of - true -> - %% Probably part of OTP. Let's check ERTS version to - %% be sure. - rabbit_misc:version_compare( - erlang:system_info(version), "5.9.1", gte); - false -> - %% Probably not part of OTP. Use the plugin to be safe. - false - catch - _:_ -> - %% Couldn't parse the version. It's not the OTP - %% application. - false - end - end; + %% eldap was added to Erlang/OTP R15B01 (ERTS 5.9.1). In this case, + %% we prefer this version to the plugin. + rabbit_misc:version_compare(erlang:system_info(version), "5.9.1", gte); plugin_provided_by_otp(_) -> false. |