Cosmetics, slightly improved warning messages

This commit is contained in:
Michael Klishin 2016-03-23 09:38:54 +03:00
parent f15a7ac8de
commit 2b9b292de4
1 changed files with 10 additions and 10 deletions

View File

@ -272,8 +272,8 @@ fun(Conf) ->
end}.
%% Select an authentication database to use. RabbitMQ comes bundled
%% with a built-in auth-database, based on mnesia.
%% Select an authentication backend to use. RabbitMQ provides an
%% internal backend in the core.
%%
%% {auth_backends, [rabbit_auth_backend_internal]},
@ -287,7 +287,7 @@ fun(Conf) ->
(amqp) -> rabbit_auth_backend_amqp;
(dummy) -> rabbit_auth_backend_dummy;
(Other) when is_atom(Other) -> Other;
(_) -> cuttlefish:invalid("Invalid auth backend")
(_) -> cuttlefish:invalid("Unknown/unsupported auth backend")
end,
AuthBackends = [{Num, {default, BackendModule(V)}} || {["auth_backends", Num], V} <- Settings],
AuthNBackends = [{Num, {authn, BackendModule(V)}} || {["auth_backends", Num, "authn"], V} <- Settings],
@ -299,7 +299,7 @@ fun(Conf) ->
Err ->
cuttlefish:invalid(
iolist_to_binary(io_lib:format(
"Auth backend number should be integer ~p", [Err])))
"Auth backend position in the chain should be an integer ~p", [Err])))
end,
NewVal = case dict:find(Num, Acc) of
{ok, {AuthN, AuthZ}} ->
@ -312,7 +312,7 @@ fun(Conf) ->
cuttlefish:invalid(
iolist_to_binary(
io_lib:format(
"Auth backend already defined for ~pth ~p backend",
"Auth backend already defined for the ~pth ~p backend",
[Num, Type])))
end;
error ->
@ -331,13 +331,13 @@ fun(Conf) ->
({Num, {undefined, AuthZ}}) ->
cuttlefish:warn(
io_lib:format(
"Auth backend undefined for ~pth authz backend. Using ~p",
"Auth backend undefined for the ~pth authz backend. Using ~p",
[Num, AuthZ])),
{AuthZ, AuthZ};
({Num, {AuthN, undefined}}) ->
cuttlefish:warn(
io_lib:format(
"Auth backend undefined for ~pth authn backend. Using ~p",
"Authz backend undefined for the ~pth authn backend. Using ~p",
[Num, AuthN])),
{AuthN, AuthN};
({_Num, {Auth, Auth}}) -> Auth;