Do not rely on behaviour info when doing config validation
This commit is contained in:
parent
87d6ad395f
commit
3c12d1a960
|
@ -718,16 +718,13 @@ get_modules_with_options() ->
|
||||||
{ok, Mods} = application:get_key(ejabberd, modules),
|
{ok, Mods} = application:get_key(ejabberd, modules),
|
||||||
lists:foldl(
|
lists:foldl(
|
||||||
fun(Mod, D) ->
|
fun(Mod, D) ->
|
||||||
Attrs = Mod:module_info(attributes),
|
case catch Mod:opt_type('') of
|
||||||
Behavs = proplists:get_value(behaviour, Attrs, []),
|
Opts when is_list(Opts) ->
|
||||||
case lists:member(ejabberd_config, Behavs) or (Mod == ?MODULE) of
|
|
||||||
true ->
|
|
||||||
Opts = Mod:opt_type(''),
|
|
||||||
lists:foldl(
|
lists:foldl(
|
||||||
fun(Opt, Acc) ->
|
fun(Opt, Acc) ->
|
||||||
dict:append(Opt, Mod, Acc)
|
dict:append(Opt, Mod, Acc)
|
||||||
end, D, Opts);
|
end, D, Opts);
|
||||||
false ->
|
{'EXIT', {undef, _}} ->
|
||||||
D
|
D
|
||||||
end
|
end
|
||||||
end, dict:new(), [?MODULE|Mods]).
|
end, dict:new(), [?MODULE|Mods]).
|
||||||
|
|
Loading…
Reference in New Issue