Skip to content

Commit a17ec9e

Browse files
Use rabbit_data_coercion:to_list/1 to coerce discovered node name to a string
Previous implementation breaks on OTP 21. [#157964874] (cherry picked from commit da011eb) (cherry picked from commit ac50a38)
1 parent 2482deb commit a17ec9e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/rabbit_peer_discovery.erl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,10 @@ normalize({error, Reason}) ->
274274
-spec format_discovered_nodes(Nodes :: list()) -> string().
275275

276276
format_discovered_nodes(Nodes) ->
277-
string:join(lists:map(fun (Val) -> hd(io_lib:format("~s", [Val])) end, Nodes), ", ").
277+
%% NOTE: in OTP 21 string:join/2 is deprecated but still available.
278+
%% Its recommended replacement is not a drop-in one, though, so
279+
%% we will not be switching just yet.
280+
string:join(lists:map(fun rabbit_data_coercion:to_list/1, Nodes), ", ").
278281

279282

280283

0 commit comments

Comments
 (0)