summaryrefslogtreecommitdiff
path: root/src/ejabberd_admin.erl
diff options
context:
space:
mode:
authorKonstantinos Kallas <konstantinos.kallas@hotmail.com>2017-08-22 14:58:12 +0300
committerKonstantinos Kallas <konstantinos.kallas@hotmail.com>2017-08-22 14:58:12 +0300
commitf1ea67817c843dcd981f3361a1e0b6fe9f8790e4 (patch)
tree5c02511f03762bd43659a4dad29d9492fec5e913 /src/ejabberd_admin.erl
parentWhitespace change (diff)
More whitespace changes
Diffstat (limited to 'src/ejabberd_admin.erl')
-rw-r--r--src/ejabberd_admin.erl74
1 files changed, 37 insertions, 37 deletions
diff --git a/src/ejabberd_admin.erl b/src/ejabberd_admin.erl
index 6db4d4e8..76cdec45 100644
--- a/src/ejabberd_admin.erl
+++ b/src/ejabberd_admin.erl
@@ -787,45 +787,45 @@ mnesia_change_nodename(FromString, ToString, Source, Target) ->
Switch =
fun
(Node) when Node == From ->
- io:format(" - Replacing nodename: '~p' with: '~p'~n", [From, To]),
- To;
- (Node) when Node == To ->
+ io:format(" - Replacing nodename: '~p' with: '~p'~n", [From, To]),
+ To;
+ (Node) when Node == To ->
%% throw({error, already_exists});
- io:format(" - Node: '~p' will not be modified (it is already '~p')~n", [Node, To]),
- Node;
- (Node) ->
- io:format(" - Node: '~p' will not be modified (it is not '~p')~n", [Node, From]),
- Node
- end,
-Convert =
-fun
-({schema, db_nodes, Nodes}, Acc) ->
- io:format(" +++ db_nodes ~p~n", [Nodes]),
- {[{schema, db_nodes, lists:map(Switch,Nodes)}], Acc};
-({schema, version, Version}, Acc) ->
- io:format(" +++ version: ~p~n", [Version]),
- {[{schema, version, Version}], Acc};
-({schema, cookie, Cookie}, Acc) ->
- io:format(" +++ cookie: ~p~n", [Cookie]),
- {[{schema, cookie, Cookie}], Acc};
-({schema, Tab, CreateList}, Acc) ->
- io:format("~n * Checking table: '~p'~n", [Tab]),
- Keys = [ram_copies, disc_copies, disc_only_copies],
- OptSwitch =
- fun({Key, Val}) ->
- case lists:member(Key, Keys) of
- true ->
- io:format(" + Checking key: '~p'~n", [Key]),
- {Key, lists:map(Switch, Val)};
- false-> {Key, Val}
- end
+ io:format(" - Node: '~p' will not be modified (it is already '~p')~n", [Node, To]),
+ Node;
+ (Node) ->
+ io:format(" - Node: '~p' will not be modified (it is not '~p')~n", [Node, From]),
+ Node
end,
- Res = {[{schema, Tab, lists:map(OptSwitch, CreateList)}], Acc},
- Res;
-(Other, Acc) ->
- {[Other], Acc}
-end,
-mnesia:traverse_backup(Source, Target, Convert, switched).
+ Convert =
+ fun
+ ({schema, db_nodes, Nodes}, Acc) ->
+ io:format(" +++ db_nodes ~p~n", [Nodes]),
+ {[{schema, db_nodes, lists:map(Switch,Nodes)}], Acc};
+ ({schema, version, Version}, Acc) ->
+ io:format(" +++ version: ~p~n", [Version]),
+ {[{schema, version, Version}], Acc};
+ ({schema, cookie, Cookie}, Acc) ->
+ io:format(" +++ cookie: ~p~n", [Cookie]),
+ {[{schema, cookie, Cookie}], Acc};
+ ({schema, Tab, CreateList}, Acc) ->
+ io:format("~n * Checking table: '~p'~n", [Tab]),
+ Keys = [ram_copies, disc_copies, disc_only_copies],
+ OptSwitch =
+ fun({Key, Val}) ->
+ case lists:member(Key, Keys) of
+ true ->
+ io:format(" + Checking key: '~p'~n", [Key]),
+ {Key, lists:map(Switch, Val)};
+ false-> {Key, Val}
+ end
+ end,
+ Res = {[{schema, Tab, lists:map(OptSwitch, CreateList)}], Acc},
+ Res;
+ (Other, Acc) ->
+ {[Other], Acc}
+ end,
+ mnesia:traverse_backup(Source, Target, Convert, switched).
clear_cache() ->
Nodes = ejabberd_cluster:get_nodes(),