From cfbf0ddb2786336dccd3b32b0db0ebc58b44597f Mon Sep 17 00:00:00 2001 From: Eduardo Olivares Date: Mon, 5 Feb 2024 10:56:26 +0100 Subject: [PATCH] Fix exceptions catched during check_overcloud_node_uptime The sh.get_uptime function only raises the exception UptimeError. Change-Id: Ic6386add86ae7723cd12f95c529ea60f1761e928 --- tobiko/shell/sh/__init__.py | 1 + tobiko/tests/faults/ha/cloud_disruptions.py | 5 ++--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tobiko/shell/sh/__init__.py b/tobiko/shell/sh/__init__.py index b1776c9c6..711f30bec 100644 --- a/tobiko/shell/sh/__init__.py +++ b/tobiko/shell/sh/__init__.py @@ -127,6 +127,7 @@ wait_for_active_systemd_units = _systemctl.wait_for_active_systemd_units wait_for_systemd_units_state = _systemctl.wait_for_systemd_units_state get_uptime = _uptime.get_uptime +UptimeError = _uptime.UptimeError assert_file_size = _wc.assert_file_size get_file_size = _wc.get_file_size diff --git a/tobiko/tests/faults/ha/cloud_disruptions.py b/tobiko/tests/faults/ha/cloud_disruptions.py index d69de88b6..0e3963413 100644 --- a/tobiko/tests/faults/ha/cloud_disruptions.py +++ b/tobiko/tests/faults/ha/cloud_disruptions.py @@ -130,9 +130,8 @@ def check_overcloud_node_uptime(ssh_client, start_time): for attempt in tobiko.retry(timeout=600., interval=10.): try: uptime = sh.get_uptime(ssh_client=ssh_client, timeout=15.) - except (sh.ShellCommandFailed, - sh.ShellTimeoutExpired, - sh.ShellProcessTerminated): + except sh.UptimeError: + LOG.exception('uptime command failed') uptime = None if uptime and uptime < (tobiko.time() - start_time):