Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

revivied Craig s code to resolved the issue that uuid has extra char when using vctl status #3129

Merged
merged 2 commits into from
Oct 23, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 4 additions & 7 deletions volttron/platform/control/control_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,23 +36,20 @@
# under Contract DE-AC05-76RL01830
# }}}
import collections
import itertools
import sys
import re
from volttron.platform import jsonapi
from volttron.platform.agent.utils import is_secure_mode
import os

_stdout = sys.stdout
_stderr = sys.stderr


def _calc_min_uuid_length(agents):
n = 0
for agent1, agent2 in itertools.combinations(agents, 2):
common_len = sum(1 for a, b in zip(agent1.uuid, agent2.uuid) if a == b)
if common_len > n:
n = common_len
return n + 1
agent_ids = [agent.uuid for agent in agents]
common_len = len(os.path.commonprefix(agent_ids))
return common_len + 1


def _list_agents(aip):
Expand Down
Loading