diff options
| author | Diana Corbacho <diana@rabbitmq.com> | 2017-07-25 11:50:23 +0100 |
|---|---|---|
| committer | Diana Corbacho <diana@rabbitmq.com> | 2017-07-25 11:50:23 +0100 |
| commit | e8a8d90c0e5737503a547431d6ec847a569c7b8c (patch) | |
| tree | 3cff9ae4bb548dbbddb7f76ea08a1ddfb827666b /src | |
| parent | e66809bbcd33593de73866dac6718726ef9053d8 (diff) | |
| download | rabbitmq-server-git-e8a8d90c0e5737503a547431d6ec847a569c7b8c.tar.gz | |
Report vhost status on vhost info
rabbitmq-management#446
[#149398495]
Diffstat (limited to 'src')
| -rw-r--r-- | src/rabbit_vhost.erl | 6 |
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). |
