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):