Skip to content

Commit

Permalink
Fix handling of port when initializing cluster
Browse files Browse the repository at this point in the history
I guess the original idea was to update creds and port only if
something has changed.

Change-Id: Iff5030ca43beb0706dfbdf393724fb319c9a73d0
Reviewed-on: https://review.couchbase.org/c/ns_server/+/175141
Well-Formed: Build Bot <build@couchbase.com>
Tested-by: Build Bot <build@couchbase.com>
Tested-by: Timofey Barmin <timofey.barmin@couchbase.com>
Reviewed-by: Artem Stemkovski <artem@couchbase.com>
  • Loading branch information
timofey-barmin committed May 26, 2022
1 parent dc6ced8 commit ef94f4f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/menelaus_web_settings.erl
Original file line number Diff line number Diff line change
Expand Up @@ -1077,8 +1077,9 @@ handle_settings_web_post(Req, Args) ->
Port = proplists:get_value(port, Args),
U = proplists:get_value(username, Args),
P = proplists:get_value(password, Args),
CurPort = menelaus_web:webconfig(port),
PortInt = case Port of
"SAME" -> menelaus_web:webconfig(port);
"SAME" -> CurPort;
_ -> list_to_integer(Port)
end,

Expand All @@ -1087,7 +1088,7 @@ handle_settings_web_post(Req, Args) ->
%% HTTP request at hand can be completed.
process_flag(trap_exit, true),

case Port =/= PortInt orelse
case PortInt =/= CurPort orelse
ns_config_auth:admin_credentials_changed(U, P) of
false -> ok; % No change.
true ->
Expand Down

0 comments on commit ef94f4f

Please sign in to comment.