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