Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include minor conditional check in sync sttaus module #560

Merged
merged 1 commit into from
Feb 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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:
ckulal marked this conversation as resolved.
Show resolved Hide resolved
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
Loading