Merge pull request #10896 from rabbitmq/tomyouyou-rabbitmq_put_vhost

Be more defensive when importing definitions where some virtual hosts do not have a default queue type
This commit is contained in:
Michael Klishin 2024-04-02 01:14:44 -04:00 committed by GitHub
commit e4da70da36
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 1 deletions

View File

@ -318,7 +318,7 @@ put_vhost(Name, Description, Tags0, Trace, Username) ->
boolean(),
rabbit_types:username()) ->
'ok' | {'error', any()} | {'EXIT', any()}.
put_vhost(Name, Description, Tags0, DefaultQueueType, Trace, Username) ->
put_vhost(Name, Description, Tags0, DefaultQueueType0, Trace, Username) ->
Tags = case Tags0 of
undefined -> <<"">>;
null -> <<"">>;
@ -326,6 +326,10 @@ put_vhost(Name, Description, Tags0, DefaultQueueType, Trace, Username) ->
"null" -> <<"">>;
Other -> Other
end,
DefaultQueueType = case DefaultQueueType0 of
<<"undefined">> -> undefined;
_ -> DefaultQueueType0
end,
ParsedTags = parse_tags(Tags),
rabbit_log:debug("Parsed tags ~tp to ~tp", [Tags, ParsedTags]),
Result = case exists(Name) of