diff options
| author | Simon MacMullen <simon@rabbitmq.com> | 2013-05-09 12:37:32 +0100 |
|---|---|---|
| committer | Simon MacMullen <simon@rabbitmq.com> | 2013-05-09 12:37:32 +0100 |
| commit | e62c7e859e2747d50392093c0eea05e84daa3067 (patch) | |
| tree | e20b3600437a853daff14b48b9c3544ac66ee8ba /src | |
| parent | a7ca9e9727b98566f09866ed9c6c89a49a08bb46 (diff) | |
| download | rabbitmq-server-git-e62c7e859e2747d50392093c0eea05e84daa3067.tar.gz | |
Validate on list
Diffstat (limited to 'src')
| -rw-r--r-- | src/rabbit_runtime_parameters.erl | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/rabbit_runtime_parameters.erl b/src/rabbit_runtime_parameters.erl index d90b7c34eb..fd0c191518 100644 --- a/src/rabbit_runtime_parameters.erl +++ b/src/rabbit_runtime_parameters.erl @@ -140,6 +140,7 @@ list(VHost) -> list(VHost, '_'). list_component(Component) -> list('_', Component). list(VHost, Component) -> + assert_vhost(VHost), Match = #runtime_parameters{key = {VHost, Component, '_'}, _ = '_'}, [p(P) || #runtime_parameters{key = {_VHost, Comp, _Name}} = P <- mnesia:dirty_match_object(?TABLE, Match), @@ -148,6 +149,12 @@ list(VHost, Component) -> list_formatted(VHost) -> [pset(value, format(pget(value, P)), P) || P <- list(VHost)]. +assert_vhost('_') -> ok; +assert_vhost(VHost) -> case rabbit_vhost:exists(VHost) of + true -> ok; + false -> throw({error, {no_such_vhost, VHost}}) + end. + lookup(VHost, Component, Name) -> case lookup0(VHost, Component, Name, rabbit_misc:const(not_found)) of not_found -> not_found; |
