diff options
| author | Matthew Sackman <matthew@rabbitmq.com> | 2010-10-20 18:47:15 +0100 |
|---|---|---|
| committer | Matthew Sackman <matthew@rabbitmq.com> | 2010-10-20 18:47:15 +0100 |
| commit | ed8adc15990260df21e5bb7159414e3f94ea29cc (patch) | |
| tree | 17f7591c3caa98cc93290a9e2e8f02e7cebbe6f7 /src | |
| parent | 9b7c7be80103ac00db23574cb22306f8ea76ae69 (diff) | |
| download | rabbitmq-server-git-ed8adc15990260df21e5bb7159414e3f94ea29cc.tar.gz | |
Supply the plugins_expand_dir application env var to rabbit as well as the activator, and then in rabbit_mnesia:reset, ensure we do not nuke out the expand dir.
Diffstat (limited to 'src')
| -rw-r--r-- | src/rabbit_mnesia.erl | 9 | ||||
| -rw-r--r-- | src/rabbit_plugin_activator.erl | 10 |
2 files changed, 8 insertions, 11 deletions
diff --git a/src/rabbit_mnesia.erl b/src/rabbit_mnesia.erl index 577d206d1b..db0ae4364b 100644 --- a/src/rabbit_mnesia.erl +++ b/src/rabbit_mnesia.erl @@ -543,9 +543,12 @@ reset(Force) -> cannot_delete_schema) end, ok = delete_cluster_nodes_config(), - %% remove persisted messages and any other garbage we find - ok = rabbit_misc:recursive_delete(filelib:wildcard(dir() ++ "/*")), - ok. + %% remove persisted messages and any other garbage we find, but + %% preserve the plugins expand dir if it's in here + {ok, UnpackedPluginDir} = application:get_env(rabbit, plugins_expand_dir), + ok = rabbit_misc:recursive_delete( + filelib:wildcard(dir() ++ "/*") -- + [filename:absname(UnpackedPluginDir)]). leave_cluster([], _) -> ok; leave_cluster(Nodes, RunningNodes) -> diff --git a/src/rabbit_plugin_activator.erl b/src/rabbit_plugin_activator.erl index 88300ab448..a4dd1b565f 100644 --- a/src/rabbit_plugin_activator.erl +++ b/src/rabbit_plugin_activator.erl @@ -56,8 +56,8 @@ start() -> application:load(rabbit), %% Determine our various directories - PluginDir = get_env(plugins_dir, ?DefaultPluginDir), - UnpackedPluginDir = get_env(plugins_expand_dir, ?DefaultUnpackedPluginDir), + {ok, PluginDir} = application:get_env(rabbit, plugins_dir), + {ok, UnpackedPluginDir} = application:get_env(rabbit, plugins_expand_dir), RootName = UnpackedPluginDir ++ "/rabbit", @@ -142,12 +142,6 @@ start() -> stop() -> ok. -get_env(Key, Default) -> - case application:get_env(rabbit, Key) of - {ok, V} -> V; - _ -> Default - end. - determine_version(App) -> application:load(App), {ok, Vsn} = application:get_key(App, vsn), |
