summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/rabbit_plugin.erl4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/rabbit_plugin.erl b/src/rabbit_plugin.erl
index 7bc75e50ab..33eaea62c2 100644
--- a/src/rabbit_plugin.erl
+++ b/src/rabbit_plugin.erl
@@ -338,7 +338,9 @@ calculate_requires_plugins(ToDisable, AllPlugins) ->
enable_one_plugin(#plugin{name = Name, version = Version, location = Path},
PluginsDir) ->
io:format("Enabling ~w-~s~n", [Name, Version]),
- case file:copy(Path, filename:join(PluginsDir, filename:basename(Path))) of
+ TargetPath = filename:join(PluginsDir, filename:basename(Path)),
+ ok = rabbit_misc:ensure_parent_dirs_exist(TargetPath),
+ case file:copy(Path, TargetPath) of
{ok, _Bytes} -> ok;
{error, Err} -> io:format("Error enabling ~p (~p)~n",
[Name, {cannot_enable_plugin, Path, Err}]),