diff options
| author | Emile Joubert <emile@rabbitmq.com> | 2012-10-12 16:43:10 +0100 |
|---|---|---|
| committer | Emile Joubert <emile@rabbitmq.com> | 2012-10-12 16:43:10 +0100 |
| commit | c5974574055244d590d054ce81b74e89d1c98a20 (patch) | |
| tree | 79c0c4187ce282e1b1b4c8513c12db90b4b83f08 | |
| parent | 44d3986d64d5db6db9d58824c08f538116c741b2 (diff) | |
| download | rabbitmq-server-git-c5974574055244d590d054ce81b74e89d1c98a20.tar.gz | |
Delete policies with vhosts
| -rw-r--r-- | src/rabbit_runtime_parameters.erl | 6 | ||||
| -rw-r--r-- | src/rabbit_vhost.erl | 4 |
2 files changed, 7 insertions, 3 deletions
diff --git a/src/rabbit_runtime_parameters.erl b/src/rabbit_runtime_parameters.erl index 564ffeea57..138b46adbf 100644 --- a/src/rabbit_runtime_parameters.erl +++ b/src/rabbit_runtime_parameters.erl @@ -206,13 +206,13 @@ list_param_strict(Component) -> list_param('_', Component, not_found). list_param(VHost, Component) -> list_param(VHost, Component, []). list_param_strict(VHost, Component) -> list_param(VHost, Component, not_found). -list_param(_VHost, <<"policy">>, _Default) -> - {error, "policies may not be listed using this method"}; list_param(VHost, Component, Default) -> case component_good(Component) of true -> Match = #runtime_parameters{key = {VHost, Component, '_'}, _ = '_'}, - [p(P) || P <- mnesia:dirty_match_object(?TABLE, Match)]; + [p(P) || #runtime_parameters{ key = {_VHost, Comp, _Key}} = P <- + mnesia:dirty_match_object(?TABLE, Match), + Comp /= <<"policy">>]; _ -> Default end. diff --git a/src/rabbit_vhost.erl b/src/rabbit_vhost.erl index f29f01046c..9beedc5142 100644 --- a/src/rabbit_vhost.erl +++ b/src/rabbit_vhost.erl @@ -98,6 +98,10 @@ internal_delete(VHostPath) -> proplists:get_value(component, Info), proplists:get_value(key, Info)) || Info <- rabbit_runtime_parameters:list_param(VHostPath)], + [ok = rabbit_runtime_parameters:clear_policy( + VHostPath, + proplists:get_value(key, Info)) + || Info <- rabbit_runtime_parameters:list_policies(VHostPath)], ok = mnesia:delete({rabbit_vhost, VHostPath}), ok. |
