From 9bbef963925c7c5f86e1774d59f488ccf2e7759d Mon Sep 17 00:00:00 2001 From: ckulal Date: Mon, 19 Feb 2024 14:19:11 +0530 Subject: [PATCH] Include minor conditional check in sync sttaus module Signed-off-by: ckulal --- rgw/v2/lib/sync_status.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/rgw/v2/lib/sync_status.py b/rgw/v2/lib/sync_status.py index 18d2d38bc..e5f4648f3 100644 --- a/rgw/v2/lib/sync_status.py +++ b/rgw/v2/lib/sync_status.py @@ -21,10 +21,15 @@ def sync_status(retry=25, delay=60, ssh_con=None): if ssh_con: log.info("Enter ssh-conn") stdin, stdout, stderr = ssh_con.exec_command(cmd) + cmd_error = stderr.read().decode() + if len(cmd_error) != 0: + log.error(f"error: {cmd_error}") check_sync_status = stdout.read().decode() else: log.info("Enter non-ssh-conn") check_sync_status = utils.exec_shell_cmd(cmd) + if not check_sync_status: + raise AssertionError("Sync status output is empty") log.info(f"sync status op is: {check_sync_status}") # check for 'failed' or 'ERROR' in sync status. if "failed" in check_sync_status or "ERROR" in check_sync_status: