Skip to content

Commit d440aaf

Browse files
Merge pull request #1433 from rabbitmq/rabbitmq-cli-226
Check that rabbit application is running when trying to enable plugins.
2 parents ff8f76d + 53d4c82 commit d440aaf

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/rabbit_plugins.erl

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,13 @@
4444

4545
%%----------------------------------------------------------------------------
4646

47-
ensure(FileJustChanged0) ->
47+
ensure(FileJustChanged) ->
48+
case rabbit:is_running() of
49+
true -> ensure1(FileJustChanged);
50+
false -> {error, rabbit_not_running}
51+
end.
52+
53+
ensure1(FileJustChanged0) ->
4854
{ok, OurFile0} = application:get_env(rabbit, enabled_plugins_file),
4955
FileJustChanged = filename:nativename(FileJustChanged0),
5056
OurFile = filename:nativename(OurFile0),

0 commit comments

Comments
 (0)