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

cli: error when no applet is specified #203

Closed
wants to merge 1 commit into from

Conversation

FFY00
Copy link
Contributor

@FFY00 FFY00 commented Sep 19, 2020

I am not sure how this came to be but apparently args.applet could be None, so we
need to check its value.

Traceback (most recent call last):
  File "/home/anubis/.virtualenvs/glasgow/bin/glasgow", line 11, in <module>
    load_entry_point('glasgow', 'console_scripts', 'glasgow')()
  File "/home/anubis/git/glasgow/software/glasgow/cli.py", line 803, in main
    exit(loop.run_until_complete(_main()))
  File "/usr/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete
    return future.result()
  File "/home/anubis/git/glasgow/software/glasgow/cli.py", line 490, in _main
    target, applet = _applet(device.revision, args)
  File "/home/anubis/git/glasgow/software/glasgow/cli.py", line 336, in _applet
    applet = GlasgowApplet.all_applets[args.applet]()
KeyError: None

Signed-off-by: Filipe Laíns lains@archlinux.org

I am not sure how this came to be but apparently args.applet could be None, so we
need to check its value.

Traceback (most recent call last):
  File "/home/anubis/.virtualenvs/glasgow/bin/glasgow", line 11, in <module>
    load_entry_point('glasgow', 'console_scripts', 'glasgow')()
  File "/home/anubis/git/glasgow/software/glasgow/cli.py", line 803, in main
    exit(loop.run_until_complete(_main()))
  File "/usr/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete
    return future.result()
  File "/home/anubis/git/glasgow/software/glasgow/cli.py", line 490, in _main
    target, applet = _applet(device.revision, args)
  File "/home/anubis/git/glasgow/software/glasgow/cli.py", line 336, in _applet
    applet = GlasgowApplet.all_applets[args.applet]()
KeyError: None

Signed-off-by: Filipe Laíns <lains@archlinux.org>
Copy link
Member

@whitequark whitequark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The applet argument should be a required one instead (it used to be that we couldn't use that feature as our minimum supported Python version was lower).

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

Successfully merging this pull request may close these issues.

None yet

2 participants