From f88498ce2253f9f58e903036f88ae4ab4d27b5fa Mon Sep 17 00:00:00 2001 From: Craig <3979063+craig8@users.noreply.github.com> Date: Fri, 3 Nov 2023 17:07:25 +0000 Subject: [PATCH] Brought back working filter --- volttron/platform/control/control_utils.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/volttron/platform/control/control_utils.py b/volttron/platform/control/control_utils.py index 8aad804fd7..c33034e2a2 100644 --- a/volttron/platform/control/control_utils.py +++ b/volttron/platform/control/control_utils.py @@ -47,9 +47,15 @@ def _calc_min_uuid_length(agents): - agent_ids = [agent.uuid for agent in agents] - common_len = len(os.path.commonprefix(agent_ids)) - return common_len + 1 + n = 0 + for agent1 in agents: + for agent2 in agents: + if agent1 is agent2: + continue + common_len = len(os.path.commonprefix([agent1.uuid, agent2.uuid])) + if common_len > n: + n = common_len + return n + 1 def _list_agents(aip):