Fix exceptions catched during check_overcloud_node_uptime

The sh.get_uptime function only raises the exception UptimeError.

Change-Id: Ic6386add86ae7723cd12f95c529ea60f1761e928
This commit is contained in:
Eduardo Olivares 2024-02-05 10:56:26 +01:00
parent 9c247d565d
commit cfbf0ddb27
2 changed files with 3 additions and 3 deletions

View File

@ -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

View File

@ -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):