diff options
| author | Daniil Fedotov <dfedotov@pivotal.io> | 2017-11-27 18:54:45 +0000 |
|---|---|---|
| committer | Daniil Fedotov <dfedotov@pivotal.io> | 2017-11-27 18:54:45 +0000 |
| commit | 53d4c82a2493f424ec71ceb5a49956397daef99f (patch) | |
| tree | 59b8451256efc0f1d7ac6b95714613032a4877b5 /src | |
| parent | ff8f76dfa17d4e7e862d06caa96523f021de7b83 (diff) | |
| download | rabbitmq-server-git-53d4c82a2493f424ec71ceb5a49956397daef99f.tar.gz | |
Check that rabbit application is running when trying to enable plugins.
If the node is started, but rabbit application is not running,
plugins can fail to start when enabled.
Check for rabbit application and return an error.
Part of #rabbitmq/rabbimq-cli#226
[#153184802]
Diffstat (limited to 'src')
| -rw-r--r-- | src/rabbit_plugins.erl | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/rabbit_plugins.erl b/src/rabbit_plugins.erl index 7c202a0b3d..5d6b4c0a7e 100644 --- a/src/rabbit_plugins.erl +++ b/src/rabbit_plugins.erl @@ -44,7 +44,13 @@ %%---------------------------------------------------------------------------- -ensure(FileJustChanged0) -> +ensure(FileJustChanged) -> + case rabbit:is_running() of + true -> ensure1(FileJustChanged); + false -> {error, rabbit_not_running} + end. + +ensure1(FileJustChanged0) -> {ok, OurFile0} = application:get_env(rabbit, enabled_plugins_file), FileJustChanged = filename:nativename(FileJustChanged0), OurFile = filename:nativename(OurFile0), |
