summaryrefslogtreecommitdiff
path: root/src/rabbit_prelaunch.erl
diff options
context:
space:
mode:
authorAlexandru Scvortov <alexandru@rabbitmq.com>2011-09-27 11:41:41 +0100
committerAlexandru Scvortov <alexandru@rabbitmq.com>2011-09-27 11:41:41 +0100
commit09c8f9f2665333ac839e4cc80afe1718a36211db (patch)
treeecfd5ba351867ea62cee28865fa8348e11bccd7e /src/rabbit_prelaunch.erl
parent383c22c18bf70bd5f8fe48b1915aa7fc826beb10 (diff)
downloadrabbitmq-server-09c8f9f2665333ac839e4cc80afe1718a36211db.tar.gz
warn when enabled plugins can't be activated because they're missing
Diffstat (limited to 'src/rabbit_prelaunch.erl')
-rw-r--r--src/rabbit_prelaunch.erl11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/rabbit_prelaunch.erl b/src/rabbit_prelaunch.erl
index 0d6f3c52..d34ed44a 100644
--- a/src/rabbit_prelaunch.erl
+++ b/src/rabbit_prelaunch.erl
@@ -151,6 +151,14 @@ prepare_plugins(EnabledPluginsFile, PluginsDistDir, DestDir) ->
AllPlugins = rabbit_plugins:find_plugins(PluginsDistDir),
Enabled = rabbit_plugins:read_enabled_plugins(EnabledPluginsFile),
ToUnpack = rabbit_plugins:calculate_required_plugins(Enabled, AllPlugins),
+ ToUnpackPlugins = rabbit_plugins:lookup_plugins(ToUnpack, AllPlugins),
+
+ Missing = Enabled -- rabbit_plugins:plugin_names(ToUnpackPlugins),
+ case Missing of
+ [] -> ok;
+ _ -> io:format("Warning: the following enabled plugins were "
+ "not found: ~p~n", [Missing])
+ end,
%% Eliminate the contents of the destination directory
case delete_recursively(DestDir) of
@@ -162,8 +170,7 @@ prepare_plugins(EnabledPluginsFile, PluginsDistDir, DestDir) ->
{error, E2} -> terminate("Could not create dir ~s (~p)", [DestDir, E2])
end,
- [prepare_plugin(Plugin, DestDir) ||
- Plugin <- rabbit_plugins:lookup_plugins(ToUnpack, AllPlugins)].
+ [prepare_plugin(Plugin, DestDir) || Plugin <- ToUnpackPlugins].
prepare_plugin(#plugin{type = ez, location = Location}, PluginDestDir) ->
zip:unzip(Location, [{cwd, PluginDestDir}]);