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

Invalid length of uuid in status #3132

Open
craig8 opened this issue Nov 3, 2023 · 1 comment
Open

Invalid length of uuid in status #3132

craig8 opened this issue Nov 3, 2023 · 1 comment
Assignees

Comments

@craig8
Copy link
Contributor

craig8 commented Nov 3, 2023

Describe the bug

This is for python 3.8 (I am unsure if later versions are different)

The uuid displayed by vctl status is incorrect.

>vctl status
9 ieee_2030_5agent-0.1.0   ed1                                     GOOD
2 listeneragent-3.3        listener                                
d listeneragent-3.3        listeneragent-3.3_2                     
f listeneragent-3.3        listeneragent-3.3_1                     
d platform_driveragent-4.0 platform.driver         0 

There should be 2 digits in the uuid position of the status

With the following code I test the method that calculates it

The method _calc_min_uuid_length is used by the platform to determine the length that should be displayed

from collections import namedtuple
import os

Agent = namedtuple('Agent', ('uuid'))

my_agents = [Agent(x) for x in ['9b171ba5-f69f-4895-a69e-b51cf4d78150',
    '2c7c8405-49c8-48eb-86ff-236ebe39da6e',
    'd73a71c8-000f-46aa-8e5f-c4436cf847c3',
    'da2c1f0d-6ce5-4095-843c-3abc861d5199',
    'f5de325c-e723-41e5-9ceb-fae722a40eb6'
]]

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

print(_calc_min_uuid_length(my_agents))

The output produced is a 1 when the correct value should be 2.

This was merged into develop in #3129.

@craig8
Copy link
Contributor Author

craig8 commented Dec 5, 2023

This is not a unit test...Please add as a unit test in order for this to be merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

2 participants