vhost inherits DQT from node
Rather than injecting node-level DQT when exporting definitions, inject it into vhost's metadata when a vhost is created.
This commit is contained in:
parent
5eb65f5f72
commit
3c95bf32e7
|
@ -146,6 +146,7 @@ add(VHost, ActingUser) ->
|
|||
rabbit_types:ok_or_error(any()).
|
||||
add(Name, Description, Tags, ActingUser) ->
|
||||
add(Name, #{description => Description,
|
||||
default_queue_type => rabbit_queue_type:default_alias(),
|
||||
tags => Tags}, ActingUser).
|
||||
|
||||
-spec add(vhost:name(), vhost:metadata(), rabbit_types:username()) ->
|
||||
|
|
|
@ -215,7 +215,8 @@ disable_protection_from_deletion(VHost) ->
|
|||
-spec new_metadata(binary(), [atom()], rabbit_queue_type:queue_type() | 'undefined') -> metadata().
|
||||
new_metadata(Description, Tags, undefined) ->
|
||||
#{description => Description,
|
||||
tags => Tags};
|
||||
default_queue_type => rabbit_queue_type:default_alias(),
|
||||
tags => Tags};
|
||||
new_metadata(Description, Tags, DefaultQueueType) ->
|
||||
#{description => Description,
|
||||
tags => Tags,
|
||||
|
|
|
@ -132,10 +132,7 @@ vhost_definitions(ReqData, VHostName, Context) ->
|
|||
ProductName = rabbit:product_name(),
|
||||
ProductVersion = rabbit:product_version(),
|
||||
|
||||
DQT = rabbit_queue_type:short_alias_of(rabbit_vhost:default_queue_type(VHostName)),
|
||||
%% note: the type changes to a map
|
||||
VHost1 = rabbit_queue_type:inject_dqt(VHost),
|
||||
Metadata = maps:get(metadata, VHost1),
|
||||
Metadata = vhost:get_metadata(VHost),
|
||||
|
||||
TopLevelDefsAndMetadata = [
|
||||
{rabbit_version, rabbit_data_coercion:to_binary(Vsn)},
|
||||
|
@ -147,7 +144,6 @@ vhost_definitions(ReqData, VHostName, Context) ->
|
|||
{explanation, rabbit_data_coercion:to_binary(io_lib:format("Definitions of virtual host '~ts'", [VHostName]))},
|
||||
{metadata, Metadata},
|
||||
{description, vhost:get_description(VHost)},
|
||||
{default_queue_type, DQT},
|
||||
{limits, vhost:get_limits(VHost)}
|
||||
],
|
||||
Result = TopLevelDefsAndMetadata ++ retain_whitelisted(Contents),
|
||||
|
|
Loading…
Reference in New Issue