{error, already_existed}
This commit is contained in:
parent
f50efa5813
commit
6245d24c83
|
@ -89,7 +89,7 @@ check_acl(Client, PubSub, Topic, [{Mod, State, _Seq}|AclMods]) ->
|
||||||
end.
|
end.
|
||||||
|
|
||||||
%% @doc Reload ACL Rules.
|
%% @doc Reload ACL Rules.
|
||||||
-spec(reload_acl() -> list(ok | {error, alread_existed})).
|
-spec(reload_acl() -> list(ok | {error, already_existed})).
|
||||||
reload_acl() ->
|
reload_acl() ->
|
||||||
[Mod:reload_acl(State) || {Mod, State, _Seq} <- lookup_mods(acl)].
|
[Mod:reload_acl(State) || {Mod, State, _Seq} <- lookup_mods(acl)].
|
||||||
|
|
||||||
|
@ -201,5 +201,5 @@ mod(Prefix, Name) ->
|
||||||
list_to_atom(lists:concat([Prefix, Name])).
|
list_to_atom(lists:concat([Prefix, Name])).
|
||||||
|
|
||||||
if_existed(false, Fun) -> Fun();
|
if_existed(false, Fun) -> Fun();
|
||||||
if_existed(_Mod, _Fun) -> {error, alread_existed}.
|
if_existed(_Mod, _Fun) -> {error, already_existed}.
|
||||||
|
|
||||||
|
|
|
@ -78,7 +78,7 @@ reload_acl(_) ->
|
||||||
|
|
||||||
register_mod(_) ->
|
register_mod(_) ->
|
||||||
ok = ?AC:register_mod(acl, emqttd_acl_test_mod, []),
|
ok = ?AC:register_mod(acl, emqttd_acl_test_mod, []),
|
||||||
{error, alread_existed} = ?AC:register_mod(acl, emqttd_acl_test_mod, []),
|
{error, already_existed} = ?AC:register_mod(acl, emqttd_acl_test_mod, []),
|
||||||
[{emqttd_acl_test_mod, _, 0},
|
[{emqttd_acl_test_mod, _, 0},
|
||||||
{emqttd_acl_internal, _, 0}] = ?AC:lookup_mods(acl),
|
{emqttd_acl_internal, _, 0}] = ?AC:lookup_mods(acl),
|
||||||
ok = ?AC:register_mod(auth, emqttd_auth_anonymous_test_mod,[]),
|
ok = ?AC:register_mod(auth, emqttd_auth_anonymous_test_mod,[]),
|
||||||
|
|
Loading…
Reference in New Issue