Skip to content

Commit

Permalink
Merge pull request #3129 from kefeimo/hot-fix/uuid-having-extr-chars
Browse files Browse the repository at this point in the history
revivied Craig s code to resolved the issue that uuid has extra char when using vctl status
  • Loading branch information
craig8 authored Oct 23, 2023
2 parents f0271c7 + 8a513f0 commit 5d96abe
Showing 1 changed file with 4 additions and 7 deletions.
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

0 comments on commit 5d96abe

Please sign in to comment.