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

Unhandled error running a subcommand in slcli #1749

Closed
edsonarios opened this issue Sep 7, 2022 · 0 comments · Fixed by #1754
Closed

Unhandled error running a subcommand in slcli #1749

edsonarios opened this issue Sep 7, 2022 · 0 comments · Fixed by #1754
Labels

Comments

@edsonarios
Copy link
Contributor

edsonarios commented Sep 7, 2022

~/ $ slcli virtual capacity
Usage: slcli virtual capacity [OPTIONS] COMMAND [ARGS]...

  Base command for all capacity related concerns

Options:
  -h, --help  Show this message and exit.

Commands:
  create          Create a Reserved Capacity instance.
  create-guest    Allows for creating a virtual guest in a reserved capacity.
  create-options  List options for creating Reserved Capacity
  detail          Reserved Capacity Group details.
  list            List Reserved Capacity groups.
~/ $ slcli virtual capacity abcd
An unexpected error has occured:
Traceback (most recent call last):
  File "\AppData\Local\Programs\Python\Python310\lib\site-packages\SoftLayer\CLI\core.py", line 182, in main
    cli.main(**kwargs)
  File "\AppData\Local\Programs\Python\Python310\lib\site-packages\click\core.py", line 1053, in main
    rv = self.invoke(ctx)
  File "\AppData\Local\Programs\Python\Python310\lib\site-packages\click\core.py", line 1659, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "\AppData\Local\Programs\Python\Python310\lib\site-packages\click\core.py", line 1659, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "\AppData\Local\Programs\Python\Python310\lib\site-packages\click\core.py", line 1653, in invoke
    cmd_name, cmd, args = self.resolve_command(ctx, args)
  File "\AppData\Local\Programs\Python\Python310\lib\site-packages\click\core.py", line 1700, in resolve_command
    cmd = self.get_command(ctx, cmd_name)
  File "\AppData\Local\Programs\Python\Python310\lib\site-packages\SoftLayer\CLI\virt\capacity\__init__.py", line 40, in get_command
    module = importlib.import_module(path)
  File "\AppData\Local\Programs\Python\Python310\lib\importlib\__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1004, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'SoftLayer.CLI.virt.capacity.abcd'

Feel free to report this error as it is likely a bug:
    https://github.com/softlayer/softlayer-python/issues
The following snippet should be able to reproduce the error

It should show a similar error when executing a command that doesn't exist

~/ $ slcli virtual abc
Usage: slcli virtual [OPTIONS] COMMAND [ARGS] ...

Try 'slcli virtual --help' for help.

Error: No such command 'abc'.

This error occurs with all subcommands
List of the subcommands

slcli object-storage credential
slcli virtual capacity
slcli virtual placementgroup
~/ $ slcli --version
Current: slcli (SoftLayer Command-line) v6.1.0
Latest:  slcli (SoftLayer Command-line) v6.1.1
@edsonarios edsonarios added the Bug label Sep 7, 2022
@edsonarios edsonarios changed the title Error not handled when executing a command that does not exist in a subcommand Unhandled error running a subcommand in slcli Sep 8, 2022
@allmightyspiff allmightyspiff linked a pull request Sep 21, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant