25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-22 16:20:52 +01:00

Fix command "update" to return response in the expected format

This commit is contained in:
Badlop 2011-12-08 19:39:36 +01:00
parent 26b814e367
commit d5ebef1362
2 changed files with 5 additions and 4 deletions

View File

@ -312,14 +312,15 @@ update_list() ->
[atom_to_list(Beam) || Beam <- UpdatedBeams]. [atom_to_list(Beam) || Beam <- UpdatedBeams].
update("all") -> update("all") ->
[update_module(ModStr) || ModStr <- update_list()]; [update_module(ModStr) || ModStr <- update_list()],
{ok, []};
update(ModStr) -> update(ModStr) ->
update_module(ModStr). update_module(ModStr).
update_module(ModuleNameString) -> update_module(ModuleNameString) ->
ModuleName = list_to_atom(ModuleNameString), ModuleName = list_to_atom(ModuleNameString),
case ejabberd_update:update([ModuleName]) of case ejabberd_update:update([ModuleName]) of
{ok, Res} -> {ok, io_lib:format("Updated: ~p", [Res])}; {ok, _Res} -> {ok, []};
{error, Reason} -> {error, Reason} {error, Reason} -> {error, Reason}
end. end.

View File

@ -44,7 +44,7 @@ update() ->
eval_script( eval_script(
LowLevelScript, [], LowLevelScript, [],
[{ejabberd, "", filename:join(Dir, "..")}]), [{ejabberd, "", filename:join(Dir, "..")}]),
?INFO_MSG("eval: ~p~n", [Eval]), ?DEBUG("eval: ~p~n", [Eval]),
Eval; Eval;
{error, Reason} -> {error, Reason} ->
{error, Reason} {error, Reason}
@ -61,7 +61,7 @@ update(ModulesToUpdate) ->
eval_script( eval_script(
LowLevelScript, [], LowLevelScript, [],
[{ejabberd, "", filename:join(Dir, "..")}]), [{ejabberd, "", filename:join(Dir, "..")}]),
?INFO_MSG("eval: ~p~n", [Eval]), ?DEBUG("eval: ~p~n", [Eval]),
Eval; Eval;
{error, Reason} -> {error, Reason} ->
{error, Reason} {error, Reason}