Skip to content

Commit

Permalink
Include minor conditional check in sync sttaus module
Browse files Browse the repository at this point in the history
Signed-off-by: ckulal <[email protected]>
  • Loading branch information
ckulal committed Feb 19, 2024
1 parent df47950 commit 9bbef96
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions rgw/v2/lib/sync_status.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 9bbef96

Please sign in to comment.