Skip to content

Commit dbd4448

Browse files
committed
Always import default data if rabbit_table:needs_default_data/0 is true
Fixes #7678 References: * #2384 * #2396 PR #2396 preserved the old behavior where definitions import took priority over the default data and environment data that may be present. This behavior continues to confuse users where they expect `RABBITMQ_DEFAULT_USER` / `RABBITMQ_DEFAULT_PASS` to be imported, especially if there is no `users` data in the definitions file. This PR allows default data and the environment to be imported first, then possibly overwritten by the definitions file.
1 parent 2b1a80f commit dbd4448

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

deps/rabbit/src/rabbit.erl

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1056,14 +1056,13 @@ recover() ->
10561056
-spec maybe_insert_default_data() -> 'ok'.
10571057

10581058
maybe_insert_default_data() ->
1059-
NoDefsToImport = not rabbit_definitions:has_configured_definitions_to_load(),
1060-
case rabbit_table:needs_default_data() andalso NoDefsToImport of
1059+
case rabbit_table:needs_default_data() of
10611060
true ->
10621061
?LOG_INFO("Will seed default virtual host and user...",
10631062
#{domain => ?RMQLOG_DOMAIN_GLOBAL}),
10641063
insert_default_data();
10651064
false ->
1066-
?LOG_INFO("Will not seed default virtual host and user: have definitions to load...",
1065+
?LOG_INFO("Will NOT seed default virtual host and user...",
10671066
#{domain => ?RMQLOG_DOMAIN_GLOBAL}),
10681067
ok
10691068
end.

0 commit comments

Comments
 (0)