summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/rabbit_vhost.erl6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/rabbit_vhost.erl b/src/rabbit_vhost.erl
index 7513c23925..1ddb8c6335 100644
--- a/src/rabbit_vhost.erl
+++ b/src/rabbit_vhost.erl
@@ -73,7 +73,7 @@ recover(VHost) ->
%%----------------------------------------------------------------------------
--define(INFO_KEYS, [name, tracing]).
+-define(INFO_KEYS, [name, tracing, state]).
add(VHostPath, ActingUser) ->
rabbit_log:info("Adding vhost '~s'~n", [VHostPath]),
@@ -253,6 +253,10 @@ infos(Items, X) -> [{Item, i(Item, X)} || Item <- Items].
i(name, VHost) -> VHost;
i(tracing, VHost) -> rabbit_trace:enabled(VHost);
+i(state, VHost) -> case rabbit_vhost_sup_sup:is_vhost_alive(VHost) of
+ true -> running;
+ false -> down
+ end;
i(Item, _) -> throw({bad_argument, Item}).
info(VHost) -> infos(?INFO_KEYS, VHost).