From 1b38f3304170d7a57715aab0607317eba0698d39 Mon Sep 17 00:00:00 2001 From: Liam Brady Date: Thu, 17 Oct 2024 13:35:36 -0400 Subject: [PATCH] tests: logger masked in topotest.py a local logger masks the global logger and prevents errors from being gracefully handled within topotest.py Signed-off-by: Liam Brady --- tests/topotests/lib/topotest.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/topotests/lib/topotest.py b/tests/topotests/lib/topotest.py index d15fefc0390e..bd989583553d 100644 --- a/tests/topotests/lib/topotest.py +++ b/tests/topotests/lib/topotest.py @@ -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: @@ -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(