Permalink
Browse files

Preserve rest port setting when leaving cluster. Bug 880

Unfortunately, it's not possible to cover this ticket with testcase
within our framework.

Change-Id: I7e4bbfe4a9a708648440a887ca9439acfaf55298
Reviewed-on: https://review.northscale.com:8443/1240
Reviewed-by: Steve Yen <steve.yen@gmail.com>
Reviewed-by: Dustin Sallings <dustin@spy.net>
Tested-by: Dustin Sallings <dustin@spy.net>
  • Loading branch information...
1 parent 10b9ca3 commit 5e33257f15af12cf000bf98bf9112704c1b6a5fa Aliaksey Kandratsenka committed with dustin Mar 26, 2010
Showing with 5 additions and 0 deletions.
  1. +5 −0 src/ns_cluster.erl
View
@@ -53,7 +53,12 @@ running(leave, State) ->
NewCookie = ns_node_disco:cookie_gen(),
erlang:set_cookie(node(), NewCookie),
lists:foreach(fun erlang:disconnect_node/1, nodes()),
+ WebPort = ns_config:search_prop(ns_config:get(), rest, port, false),
ns_config:clear([directory]),
+ case WebPort of
+ false -> false;
+ _ -> ns_config:set(rest, [{port, WebPort}])
+ end,
ns_config:set(nodes_wanted, [node()], {0, 0, 0}),
ns_config:set(otp, [{cookie, NewCookie}], {0, 0, 0}),
true = exit(State#running_state.child, shutdown),

0 comments on commit 5e33257

Please sign in to comment.