{error, already_existed}

This commit is contained in:
Feng Lee 2016-05-05 15:44:36 +08:00
parent f50efa5813
commit 6245d24c83
2 changed files with 3 additions and 3 deletions

View File

@ -89,7 +89,7 @@ check_acl(Client, PubSub, Topic, [{Mod, State, _Seq}|AclMods]) ->
end.
%% @doc Reload ACL Rules.
-spec(reload_acl() -> list(ok | {error, alread_existed})).
-spec(reload_acl() -> list(ok | {error, already_existed})).
reload_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])).
if_existed(false, Fun) -> Fun();
if_existed(_Mod, _Fun) -> {error, alread_existed}.
if_existed(_Mod, _Fun) -> {error, already_existed}.

View File

@ -78,7 +78,7 @@ reload_acl(_) ->
register_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_internal, _, 0}] = ?AC:lookup_mods(acl),
ok = ?AC:register_mod(auth, emqttd_auth_anonymous_test_mod,[]),