Skip to content

Commit

Permalink
Fix traceback with weird debug level, but ruff is unhappy
Browse files Browse the repository at this point in the history
Traceback (most recent call last):
  File "/home/psss/.local/share/hatch/env/virtual/tmt/v_yBwOy-/dev/bin/tmt", line 5, in <module>
    from tmt.__main__ import run_cli
  File "/home/psss/git/tmt/tmt/__init__.py", line 20, in <module>
    from tmt.base import Clean, Plan, Run, Status, Story, Test, Tree
  File "/home/psss/git/tmt/tmt/base.py", line 57, in <module>
    import tmt.utils.jira
  File "/home/psss/git/tmt/tmt/utils/jira.py", line 21, in <module>
    tmt.log.Logger.get_bootstrap_logger())
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/psss/git/tmt/tmt/log.py", line 871, in get_bootstrap_logger
    cls._bootstrap_logger = Logger.create(actual_logger=actual_logger)
                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/psss/git/tmt/tmt/log.py", line 686, in create
    return Logger(
           ^^^^^^^
  File "/home/psss/git/tmt/tmt/log.py", line 629, in apply_verbosity_options
    debug_level_from_global_envvar = _debug_level_from_global_envvar()
                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/psss/git/tmt/tmt/log.py", line 123, in _debug_level_from_global_envvar
    raise tmt.utils.GeneralError(f"Invalid debug level '{raw_value}', use an integer.")
tmt.utils.GeneralError: Invalid debug level 'weird', use an integer.
  • Loading branch information
psss committed Sep 25, 2024
1 parent f52d782 commit 0c630b7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tmt/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@
import tmt.templates
import tmt.utils
import tmt.utils.git
import tmt.utils.jira
from tmt.checks import Check
from tmt.lint import LinterOutcome, LinterReturn
from tmt.result import Result
Expand Down Expand Up @@ -1292,6 +1291,7 @@ def _get_template_content(template: str, template_type: str) -> str:
force=force,
logger=logger)

import tmt.utils.jira
if links.get('verifies') and dry is False:
tests = Tree(
path=path,
Expand Down Expand Up @@ -2027,6 +2027,7 @@ def create(
force=force,
logger=logger)

import tmt.utils.jira
if links.get('verifies') and dry is False:
plans = Tree(
path=path,
Expand Down Expand Up @@ -2749,6 +2750,7 @@ def create(
force=force,
logger=logger)

import tmt.utils.jira
if links.get('verifies') and dry is False:
stories = Tree(
path=path,
Expand Down

0 comments on commit 0c630b7

Please sign in to comment.