This is an automated email from the ASF dual-hosted git repository. vatamane pushed a commit to branch 3.x in repository https://gitbox.apache.org/repos/asf/couchdb.git
commit dbbac3ec927b89c12639ff1953ee33a2cca86fa7 Author: Nick Vatamaniuc <[email protected]> AuthorDate: Tue Apr 5 23:29:47 2022 -0400 Fix undefined cookie in weatherreport_node If the cookie is undefined then we should not set it so it can pick up the ~/.erlang.cookie if it is there. --- src/weatherreport/src/weatherreport_node.erl | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/weatherreport/src/weatherreport_node.erl b/src/weatherreport/src/weatherreport_node.erl index 81d868c39..d108d0f7f 100644 --- a/src/weatherreport/src/weatherreport_node.erl +++ b/src/weatherreport/src/weatherreport_node.erl @@ -204,7 +204,13 @@ start_net() -> {Type, NodeName} = weatherreport_config:node_name(), ThisNode = append_node_suffix(NodeName, "_diag"), {ok, _} = net_kernel:start([ThisNode, Type]), - erlang:set_cookie(node(), weatherreport_config:cookie()). + case weatherreport_config:cookie() of + undefined -> + % Don't set cookie to undefined so we can pick up the ~/.erlang.cookie + ok; + Cookie when is_atom(Cookie) -> + erlang:set_cookie(node(), Cookie) + end. append_node_suffix(Name, Suffix) -> case string:tokens(Name, "@") of
