Skip to content
Closed
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
10 changes: 5 additions & 5 deletions files/scripts/swss.sh
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ function clean_up_chassis_db_tables()
return
fi

until [[ $($SONIC_DB_CLI CHASSIS_APP_DB PING | grep -c True) -gt 0 ]]; do
until [[ $(sonic-db-cli CHASSIS_APP_DB PING | grep -c True) -gt 0 ]]; do
sleep 1
done

Expand All @@ -151,7 +151,7 @@ function clean_up_chassis_db_tables()
debug "Chassis db clean up for ${SERVICE}$DEV. asic=$asic"

# First, delete SYSTEM_NEIGH entries
num_neigh=`$SONIC_DB_CLI CHASSIS_APP_DB EVAL "
num_neigh=`sonic-db-cli CHASSIS_APP_DB EVAL "
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is very difficult to understand the diffence between sonic-db-cli and $SONIC_DB_CLI, making code very difficult to maintain, like landmine.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could add a different variable to use sonic-db-cli from host:

if [ "$DEV" ]; then
    NET_NS="$NAMESPACE_PREFIX$DEV" #name of the network namespace
    SONIC_DB_CLI="sonic-db-cli -n $NET_NS"
    SONIC_DB_CLI_HOST="sonic-db-cli"
else
    NET_NS=""
    SONIC_DB_CLI="sonic-db-cli"
    SONIC_DB_CLI_HOST="sonic-db-cli"
fi

local nn = 0
local host = string.gsub(ARGV[1], '%-', '%%-')
local dev = ARGV[2]
Expand All @@ -178,7 +178,7 @@ function clean_up_chassis_db_tables()
fi

# Next, delete SYSTEM_INTERFACE entries
num_sys_intf=`$SONIC_DB_CLI CHASSIS_APP_DB EVAL "
num_sys_intf=`sonic-db-cli CHASSIS_APP_DB EVAL "
local nsi = 0
local host = string.gsub(ARGV[1], '%-', '%%-')
local dev = ARGV[2]
Expand All @@ -195,7 +195,7 @@ function clean_up_chassis_db_tables()
debug "Chassis db clean up for ${SERVICE}$DEV. Number of SYSTEM_INTERFACE entries deleted: $num_sys_intf"

# Next, delete SYSTEM_LAG_MEMBER_TABLE entries
num_lag_mem=`$SONIC_DB_CLI CHASSIS_APP_DB EVAL "
num_lag_mem=`sonic-db-cli CHASSIS_APP_DB EVAL "
local nlm = 0
local host = string.gsub(ARGV[1], '%-', '%%-')
local dev = ARGV[2]
Expand All @@ -220,7 +220,7 @@ function clean_up_chassis_db_tables()
fi

# Finally, delete SYSTEM_LAG_TABLE entries and deallot LAG IDs
num_sys_lag=`$SONIC_DB_CLI CHASSIS_APP_DB EVAL "
num_sys_lag=`sonic-db-cli CHASSIS_APP_DB EVAL "
local nsl = 0
local host = string.gsub(ARGV[1], '%-', '%%-')
local dev = ARGV[2]
Expand Down