summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlexandru Scvortov <alexandru@rabbitmq.com>2011-09-20 10:09:09 +0100
committerAlexandru Scvortov <alexandru@rabbitmq.com>2011-09-20 10:09:09 +0100
commitf9c769b1ecef5705486ad58cd16529bcf09a679d (patch)
treecd44339b5b49aa855652695165548d9f86e75de4 /src
parentb0c0265cfb97959833bd1c7bb46619232f330aa7 (diff)
downloadrabbitmq-server-git-f9c769b1ecef5705486ad58cd16529bcf09a679d.tar.gz
ensure the plugins dir exists before trying to copy files to it
Diffstat (limited to 'src')
-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}]),