From 7ea695378a44c53f2a772cd55547580b1b3b4891 Mon Sep 17 00:00:00 2001 From: Zack Cerza Date: Wed, 2 Aug 2023 11:04:21 -0600 Subject: [PATCH 1/2] PhysicalConsole.check_status(): Use log.exception Signed-off-by: Zack Cerza --- teuthology/orchestra/console.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/teuthology/orchestra/console.py b/teuthology/orchestra/console.py index 6361cd428..ade67e46b 100644 --- a/teuthology/orchestra/console.py +++ b/teuthology/orchestra/console.py @@ -196,8 +196,8 @@ def check_status(self, timeout=None): # check for login prompt at console self._wait_for_login(timeout) return True - except Exception as e: - self.log.info('Failed to get ipmi console status: {e}'.format(e=e)) + except Exception: + self.log.exception('Failed to get ipmi console status') return False def power_cycle(self, timeout=300): From 1964350871127ed5d9e17d00b8dac440552e548e Mon Sep 17 00:00:00 2001 From: Zack Cerza Date: Wed, 2 Aug 2023 12:03:21 -0600 Subject: [PATCH 2/2] PhysicalConsole: Tolerate invalid UTF-8 characters ... in pexpect.spawn() calls. Fixes: https://tracker.ceph.com/issues/62226 Signed-off-by: Zack Cerza --- teuthology/orchestra/console.py | 1 + 1 file changed, 1 insertion(+) diff --git a/teuthology/orchestra/console.py b/teuthology/orchestra/console.py index ade67e46b..3afed56c4 100644 --- a/teuthology/orchestra/console.py +++ b/teuthology/orchestra/console.py @@ -76,6 +76,7 @@ def _pexpect_spawn(self, cmd): p = pexpect.spawn( cmd, encoding='utf-8', + codec_errors="backslashreplace", ) p.logfile_read = io.StringIO() return p