Skip to content
This repository has been archived by the owner on Nov 17, 2020. It is now read-only.

Commit

Permalink
Merge pull request #329 from rabbitmq/rabbitmq-cli-165
Browse files Browse the repository at this point in the history
Use cleaner vhost limit listing API
  • Loading branch information
michaelklishin committed Jan 17, 2017
2 parents d36f75d + eedb5e4 commit 8937546
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
6 changes: 4 additions & 2 deletions src/rabbit_mgmt_wm_limits.erl
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,10 @@ limits(ReqData, Context) ->
|| {VHost, Value} <- rabbit_vhost_limit:list(),
lists:member(VHost, VisibleVhosts) ];
VHost when is_binary(VHost) ->
[ [{vhost, AVHost}, {value, Value}]
|| {AVHost, Value} <- rabbit_vhost_limit:list(VHost)]
case rabbit_vhost_limit:list(VHost) of
[] -> [];
Value -> [[{vhost, VHost}, {value, Value}]]
end
end.
%%--------------------------------------------------------------------

3 changes: 1 addition & 2 deletions test/rabbit_mgmt_http_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -2181,7 +2181,6 @@ vhost_limits_list_test(Config) ->

Limits1 = [#{vhost => <<"limit_test_vhost_1">>,
value => #{'max-connections' => 100, 'max-queues' => 100}}],

Limits2 = [#{vhost => <<"limit_test_vhost_2">>,
value => #{'max-connections' => 200}}],

Expand Down Expand Up @@ -2272,7 +2271,7 @@ vhost_limit_set_test(Config) ->
Limits4 = [#{vhost => <<"limit_test_vhost_1">>,
value => #{'max-queues' => 100}}],
Limits4 = http_get(Config, "/vhost-limits/limit_test_vhost_1", ?OK),

%% Only admin can clear limits
http_delete(Config, "/vhost-limits/limit_test_vhost_1/max-queues", Vhost1User, Vhost1User, ?NOT_AUTHORISED),

Expand Down

0 comments on commit 8937546

Please sign in to comment.