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

Handle client deletion by name #68

Closed
goldyfruit opened this issue Jun 16, 2023 · 3 comments
Closed

Handle client deletion by name #68

goldyfruit opened this issue Jun 16, 2023 · 3 comments

Comments

@goldyfruit
Copy link
Contributor

When trying to delete a client with its name instead of the ID.

Traceback (most recent call last):
  File "/home/goldyfruit/Virtualenvs/hivemind/bin/hivemind-core", line 33, in <module>
    sys.exit(load_entry_point('jarbas-hive-mind==0.13.0a1', 'console_scripts', 'hivemind-core')())
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/goldyfruit/Virtualenvs/hivemind/lib64/python3.11/site-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/goldyfruit/Virtualenvs/hivemind/lib64/python3.11/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/home/goldyfruit/Virtualenvs/hivemind/lib64/python3.11/site-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/goldyfruit/Virtualenvs/hivemind/lib64/python3.11/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/goldyfruit/Virtualenvs/hivemind/lib64/python3.11/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/goldyfruit/Virtualenvs/hivemind/lib64/python3.11/site-packages/hivemind_core/scripts.py", line 59, in delete_client
    if x["client_id"] == int(node_id):
                         ^^^^^^^^^^^^
ValueError: invalid literal for int() with base 10: 'HiveMind-Node-0'
@JarbasAl
Copy link
Member

names are not guaranteed to be unique, they are just friendly names for UI

using the unique identifier is required, not a bug but will add more info the the --help command

@goldyfruit
Copy link
Contributor Author

names are not guaranteed to be unique, they are just friendly names for UI

using the unique identifier is required, not a bug but will add more info the the --help command

Maybe just make sure than ID is an integer if not then a message could be displayed to the user like please use the ID not the name.

@JarbasAl
Copy link
Member

last commit should have handled this

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

No branches or pull requests

2 participants