Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:Ledest:erlang:24
erlang
4292-Improve-observer-node-list-menu-in-distrib...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 4292-Improve-observer-node-list-menu-in-distribution-edge.patch of Package erlang
From e26584bc05f8a9784c531599fd0a6bae85ad1c49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A9ter=20G=C3=B6m=C3=B6ri?= <gomoripeti@gmail.com> Date: Mon, 30 May 2022 01:38:11 +0200 Subject: [PATCH 2/2] Improve observer node list menu in distribution edge cases - Always include current node. If dist_listen is false it won't show up in epdm names - If the default epmd module erl_epmd is used and erl_epmd_port is set to `DistPort' then it is only possible to connect to the node listening on DistPort (if any), so exclude other nodes registered in EPMD --- lib/observer/src/observer_wx.erl | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/lib/observer/src/observer_wx.erl b/lib/observer/src/observer_wx.erl index dea7e07db0..321f189fc9 100644 --- a/lib/observer/src/observer_wx.erl +++ b/lib/observer/src/observer_wx.erl @@ -752,7 +752,7 @@ get_nodes() -> {ok, Names} -> epmd_nodes(Names) end ++ - nodes(connected) + [node() | nodes(connected)] end, Nodes = lists:usort(Nodes0), WarningText = "WARNING: connecting to non-erlang nodes may crash them", @@ -764,7 +764,28 @@ get_nodes() -> end, {1, []}, Nodes), {Nodes, lists:reverse(Menues)}. -epmd_nodes(Names) -> +%% see erl_epmd:(listen_)port_please/2 +erl_dist_port() -> + try + erl_epmd = net_kernel:epmd_module(), + {ok, [[StringPort]]} = init:get_argument(erl_epmd_port), + list_to_integer(StringPort) + catch + _:_ -> + undefined + end. + +%% If the default epmd module erl_epmd is used and erl_epmd_port is +%% set to `DistPort' then it is only possible to connect to the node +%% listening on DistPort (if any), so exclude other nodes registered +%% in EPMD +epmd_nodes(Names0) -> + Names = case erl_dist_port() of + undefined -> + Names0; + DistPort -> + [NP || NP = {_, Port} <- Names0, Port =:= DistPort] + end, [_, Host] = string:lexemes(atom_to_list(node()),"@"), [list_to_atom(Name ++ [$@|Host]) || {Name, _} <- Names]. -- 2.35.3
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor