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

Setting an invalid config values disallows setting a correct one #67

Open
melvio opened this issue Sep 8, 2021 · 1 comment
Open

Setting an invalid config values disallows setting a correct one #67

melvio opened this issue Sep 8, 2021 · 1 comment
Labels
bug Something isn't working hopla-config hopla config command

Comments

@melvio
Copy link
Owner

melvio commented Sep 8, 2021

Bug:

$ hopla config cmd_all.loglevel debu
cmd_all.loglevel=debu

$ hopla config cmd_all.loglevel debug
hopla config cmd_all.loglevel debug
Traceback (most recent call last):
  File "/home/m/Documents/lcl/melvio/hopla/venv/bin/hopla", line 33, in <module>
    sys.exit(load_entry_point('hopla', 'console_scripts', 'hopla')())
  File "/home/m/Documents/lcl/melvio/hopla/venv/bin/hopla", line 25, in importlib_load_entry_point
    return next(matches).load()
  File "/usr/lib/python3.8/importlib/metadata.py", line 77, in load
    module = import_module(match.group('module'))
  File "/usr/lib/python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 848, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/home/m/Documents/lcl/melvio/hopla/src/hopla/__init__.py", line 50, in <module>
    log = setup_logging()
  File "/home/m/Documents/lcl/melvio/hopla/src/hopla/__init__.py", line 44, in setup_logging
    level=loglevel_mapping[parsed_loglevel],
KeyError: 'debu'

Version: commit: 84f31b3

Proposed solution: Input validation when setting config vargs.

@melvio melvio added the bug Something isn't working label Sep 8, 2021
@melvio melvio changed the title An invalid config param disallows setting a correct one Setting an invalid config values disallows setting a correct one Sep 18, 2021
@melvio
Copy link
Owner Author

melvio commented Sep 18, 2021

Workaround: Change the config file manually. Or delete the config file and restart fresh.

@melvio melvio added the hopla-config hopla config command label Sep 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working hopla-config hopla config command
Projects
None yet
Development

No branches or pull requests

1 participant