Skip to content

Commit

Permalink
Modify the check to handle redis retrieval failures
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanzhu706 committed Jun 3, 2024
1 parent 1c722c3 commit c37c1a4
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 7 deletions.
Binary file added scripts/.fast-reboot.swm
Binary file not shown.
Binary file added scripts/.fast-reboot.swn
Binary file not shown.
Binary file added scripts/.fast-reboot.swo
Binary file not shown.
Binary file modified scripts/.fast-reboot.swp
Binary file not shown.
15 changes: 8 additions & 7 deletions scripts/fast-reboot
Original file line number Diff line number Diff line change
Expand Up @@ -281,18 +281,19 @@ function check_mirror_session_acls()
start_time=${SECONDS}
elapsed_time=$((${SECONDS} - ${start_time}))
while [[ ${elapsed_time} -lt 10 ]]; do
ACL_ENTRIES=( $(redis-cli -n 1 KEYS "*" | grep SAI_OBJECT_TYPE_ACL_ENTRY) )
if [[ $? -ne 0 ]]; then
error "Failed to retrieve from redis"
CHECK_ACL_ENTRIES=0
ACL_OUTPUT=$(sonic-db-cli ASIC_DB KEYS "*" | grep SAI_OBJECT_TYPE_ACL_ENTRY) || CHECK_ACL_ENTRIES=$?
if [[ CHECK_ACL_ENTRIES -ne 0 ]]; then
error "Failed to retrieve SAI_OBJECT_TYPE_ACL_ENTRY from redis"
exit ${EXIT_NO_MIRROR_SESSION_ACLS}
fi
ACL_COUNT=${#ACL_ENTRIES[@]}
if [[ ${ACL_COUNT} -eq 0 ]]; then
error "NO ACL_ENTRY objects found"
ACL_ENTRIES=( ${ACL_OUTPUT} )
if [[ ${ACL_ENTRIES} -eq 0 ]]; then
error "NO SAI_OBJECT_TYPE_ACL_ENTRY objects found"
exit ${EXIT_NO_MIRROR_SESSION_ACLS}
fi
for ACL_ENTRY in ${ACL_ENTRIES[@]}; do
ACL_PRIORITY=$(redis-cli -n 1 HGET ${ACL_ENTRY} SAI_ACL_ENTRY_ATTR_PRIORITY)
ACL_PRIORITY=$(sonic-db-cli ASIC_DB HGET ${ACL_ENTRY} SAI_ACL_ENTRY_ATTR_PRIORITY)
if [[ ${ACL_PRIORITY} -eq 8888 ]]; then
ACL_ARP="found"
fi
Expand Down

0 comments on commit c37c1a4

Please sign in to comment.