Skip to content

Commit

Permalink
tests: logger masked in topotest.py
Browse files Browse the repository at this point in the history
a local logger masks the global logger and prevents errors from being
gracefully handled within topotest.py

Signed-off-by: Liam Brady <lbrady@labn.net>
  • Loading branch information
liambrady committed Oct 17, 2024
1 parent 466efab commit 1b38f33
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/topotests/lib/topotest.py
Original file line number Diff line number Diff line change
Expand Up @@ -1244,8 +1244,8 @@ def _sysctl_assure(commander, variable, value):
def sysctl_atleast(commander, variable, min_value, raises=False):
try:
if commander is None:
logger = logging.getLogger("topotest")
commander = micronet.Commander("sysctl", logger=logger)
topotest_logger = logging.getLogger("topotest")
commander = micronet.Commander("sysctl", logger=topotest_logger)

return _sysctl_atleast(commander, variable, min_value)
except subprocess.CalledProcessError as error:
Expand All @@ -1262,8 +1262,8 @@ def sysctl_atleast(commander, variable, min_value, raises=False):
def sysctl_assure(commander, variable, value, raises=False):
try:
if commander is None:
logger = logging.getLogger("topotest")
commander = micronet.Commander("sysctl", logger=logger)
topotest_logger = logging.getLogger("topotest")
commander = micronet.Commander("sysctl", logger=topotest_logger)
return _sysctl_assure(commander, variable, value)
except subprocess.CalledProcessError as error:
logger.warning(
Expand Down

0 comments on commit 1b38f33

Please sign in to comment.