Skip to content

Commit 1850481

Browse files
authored
Merge pull request rabbitmq#1304 from rabbitmq/rabbitmq-management-446
Report vhost status on vhost info
2 parents 481dd67 + 762e7b0 commit 1850481

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/rabbit_vhost.erl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ recover(VHost) ->
7575

7676
%%----------------------------------------------------------------------------
7777

78-
-define(INFO_KEYS, [name, tracing]).
78+
-define(INFO_KEYS, [name, tracing, state]).
7979

8080
add(VHostPath, ActingUser) ->
8181
rabbit_log:info("Adding vhost '~s'~n", [VHostPath]),
@@ -261,6 +261,10 @@ infos(Items, X) -> [{Item, i(Item, X)} || Item <- Items].
261261

262262
i(name, VHost) -> VHost;
263263
i(tracing, VHost) -> rabbit_trace:enabled(VHost);
264+
i(state, VHost) -> case rabbit_vhost_sup_sup:is_vhost_alive(VHost) of
265+
true -> running;
266+
false -> down
267+
end;
264268
i(Item, _) -> throw({bad_argument, Item}).
265269

266270
info(VHost) -> infos(?INFO_KEYS, VHost).

0 commit comments

Comments
 (0)