fix(emqx schema): fix function clause by user_lookup_fun

This commit is contained in:
zhanghongtong 2021-10-18 16:37:04 +08:00
parent c73205a589
commit b1bf21c73b
1 changed files with 8 additions and 1 deletions

View File

@ -1319,7 +1319,7 @@ validate_heap_size(Siz) ->
false -> ok
end.
parse_user_lookup_fun(StrConf) ->
[ModStr, FunStr] = string:tokens(StrConf, ":"),
[ModStr, FunStr] = string:tokens(str(StrConf), ":"),
Mod = list_to_atom(ModStr),
Fun = list_to_atom(FunStr),
{fun Mod:Fun/3, undefined}.
@ -1338,3 +1338,10 @@ validate_tls_versions(Versions) ->
[] -> ok;
Vs -> {error, {unsupported_ssl_versions, Vs}}
end.
str(A) when is_atom(A) ->
atom_to_list(A);
str(B) when is_binary(B) ->
binary_to_list(B);
str(S) when is_list(S) ->
S.