Skip to content

Commit f40f273

Browse files
dzhangalibabatiantianlv
authored andcommitted
[MultiDB] (except ./src and ./dockers dirs): replace redis-cli with sonic-db-cli and use new DBConnector (sonic-net#4035)
* [MultiDB] (except ./src and ./dockers dirs): replace redis-cli with sonic-db-cli and use new DBConnector * update comment for a potential bug * update comment * add TODO maker as review reqirement
1 parent 701b7f1 commit f40f273

File tree

17 files changed

+64
-72
lines changed

17 files changed

+64
-72
lines changed

device/mellanox/x86_64-mlnx_msn2700-r0/plugins/sfputil.py

+3-6
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@
2222
SFP_I2C_PAGE_SIZE = 256
2323

2424
# parameters for DB connection
25-
REDIS_HOSTNAME = "localhost"
26-
REDIS_PORT = 6379
2725
REDIS_TIMEOUT_USECS = 0
2826

2927
# parameters for SFP presence
@@ -190,10 +188,9 @@ def get_transceiver_change_event(self, timeout=0):
190188

191189
if self.db_sel == None:
192190
from swsscommon import swsscommon
193-
self.state_db = swsscommon.DBConnector(swsscommon.STATE_DB,
194-
REDIS_HOSTNAME,
195-
REDIS_PORT,
196-
REDIS_TIMEOUT_USECS)
191+
self.state_db = swsscommon.DBConnector("STATE_DB",
192+
REDIS_TIMEOUT_USECS,
193+
True))
197194

198195
# Subscribe to state table for SFP change notifications
199196
self.db_sel = swsscommon.Select()

files/build_templates/docker_image_ctl.j2

+21-17
Original file line numberDiff line numberDiff line change
@@ -89,20 +89,20 @@ function preStartAction()
8989
docker cp /tmp/dump.rdb database:/var/lib/redis/
9090
fi
9191
{%- elif docker_container_name == "snmp" %}
92-
docker exec -i database redis-cli -n 6 HSET 'DEVICE_METADATA|localhost' chassis_serial_number $(decode-syseeprom -s)
93-
vrfenabled=`/usr/bin/redis-cli -n 4 hget "MGMT_VRF_CONFIG|vrf_global" mgmtVrfEnabled`
94-
v1SnmpTrapIp=`/usr/bin/redis-cli -n 4 hget "SNMP_TRAP_CONFIG|v1TrapDest" DestIp`
95-
v1SnmpTrapPort=`/usr/bin/redis-cli -n 4 hget "SNMP_TRAP_CONFIG|v1TrapDest" DestPort`
96-
v1Vrf=`/usr/bin/redis-cli -n 4 hget "SNMP_TRAP_CONFIG|v1TrapDest" vrf`
97-
v1Comm=`/usr/bin/redis-cli -n 4 hget "SNMP_TRAP_CONFIG|v1TrapDest" Community`
98-
v2SnmpTrapIp=`/usr/bin/redis-cli -n 4 hget "SNMP_TRAP_CONFIG|v2TrapDest" DestIp`
99-
v2SnmpTrapPort=`/usr/bin/redis-cli -n 4 hget "SNMP_TRAP_CONFIG|v2TrapDest" DestPort`
100-
v2Vrf=`/usr/bin/redis-cli -n 4 hget "SNMP_TRAP_CONFIG|v2TrapDest" vrf`
101-
v2Comm=`/usr/bin/redis-cli -n 4 hget "SNMP_TRAP_CONFIG|v2TrapDest" Community`
102-
v3SnmpTrapIp=`/usr/bin/redis-cli -n 4 hget "SNMP_TRAP_CONFIG|v3TrapDest" DestIp`
103-
v3SnmpTrapPort=`/usr/bin/redis-cli -n 4 hget "SNMP_TRAP_CONFIG|v3TrapDest" DestPort`
104-
v3Vrf=`/usr/bin/redis-cli -n 4 hget "SNMP_TRAP_CONFIG|v3TrapDest" vrf`
105-
v3Comm=`/usr/bin/redis-cli -n 4 hget "SNMP_TRAP_CONFIG|v3TrapDest" Community`
92+
sonic-db-cli STATE_DB HSET 'DEVICE_METADATA|localhost' chassis_serial_number $(decode-syseeprom -s)
93+
vrfenabled=`sonic-db-cli CONFIG_DB hget "MGMT_VRF_CONFIG|vrf_global" mgmtVrfEnabled`
94+
v1SnmpTrapIp=`sonic-db-cli CONFIG_DB hget "SNMP_TRAP_CONFIG|v1TrapDest" DestIp`
95+
v1SnmpTrapPort=`sonic-db-cli CONFIG_DB hget "SNMP_TRAP_CONFIG|v1TrapDest" DestPort`
96+
v1Vrf=`sonic-db-cli CONFIG_DB hget "SNMP_TRAP_CONFIG|v1TrapDest" vrf`
97+
v1Comm=`sonic-db-cli CONFIG_DB hget "SNMP_TRAP_CONFIG|v1TrapDest" Community`
98+
v2SnmpTrapIp=`sonic-db-cli CONFIG_DB hget "SNMP_TRAP_CONFIG|v2TrapDest" DestIp`
99+
v2SnmpTrapPort=`sonic-db-cli CONFIG_DB hget "SNMP_TRAP_CONFIG|v2TrapDest" DestPort`
100+
v2Vrf=`sonic-db-cli CONFIG_DB hget "SNMP_TRAP_CONFIG|v2TrapDest" vrf`
101+
v2Comm=`sonic-db-cli CONFIG_DB hget "SNMP_TRAP_CONFIG|v2TrapDest" Community`
102+
v3SnmpTrapIp=`sonic-db-cli CONFIG_DB hget "SNMP_TRAP_CONFIG|v3TrapDest" DestIp`
103+
v3SnmpTrapPort=`sonic-db-cli CONFIG_DB hget "SNMP_TRAP_CONFIG|v3TrapDest" DestPort`
104+
v3Vrf=`sonic-db-cli CONFIG_DB hget "SNMP_TRAP_CONFIG|v3TrapDest" vrf`
105+
v3Comm=`sonic-db-cli CONFIG_DB hget "SNMP_TRAP_CONFIG|v3TrapDest" Community`
106106

107107
if [ "${v1SnmpTrapIp}" != "" ]
108108
then
@@ -139,7 +139,11 @@ function preStartAction()
139139
fi
140140

141141
echo -n "" > /tmp/snmpagentaddr.yml
142-
keys=`/usr/bin/redis-cli -n 4 keys "SNMP_AGENT_ADDRESS_CONFIG|*"`
142+
# TODO
143+
# we should avoid using 'keys' operation via redis-cli or sonic-db-cli
144+
# there would be an issue when KEY in database contains space or '\n'
145+
# for loop on the non-tty 'keys' output will take the space or `\n` as seperator when parsing the element
146+
keys=`sonic-db-cli CONFIG_DB keys "SNMP_AGENT_ADDRESS_CONFIG|*"`
143147
count=1
144148
for key in $keys;do
145149
ip=`echo $key|cut -d "|" -f2`
@@ -180,10 +184,10 @@ function postStartAction()
180184

181185
if [[ "$BOOT_TYPE" == "fast" ]]; then
182186
# set the key to expire in 3 minutes
183-
redis-cli -n 6 SET "FAST_REBOOT|system" "1" "EX" "180"
187+
sonic-db-cli STATE_DB SET "FAST_REBOOT|system" "1" "EX" "180"
184188
fi
185189

186-
redis-cli -n 4 SET "CONFIG_DB_INITIALIZED" "1"
190+
sonic-db-cli CONFIG_DB SET "CONFIG_DB_INITIALIZED" "1"
187191
fi
188192

189193
if [[ -x /usr/bin/db_migrator.py ]]; then

files/image_config/config-setup/config-setup

+5-6
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
###########################################################################
2626

2727
# Initialize constants
28-
CONFIG_DB_INDEX=4
2928
UPDATEGRAPH_CONF=/etc/sonic/updategraph.conf
3029
CONFIG_DB_JSON=/etc/sonic/config_db.json
3130
MINGRAPH_FILE=/etc/sonic/minigraph.xml
@@ -107,9 +106,9 @@ reload_minigraph()
107106
if [ ! -f /etc/sonic/init_cfg.json ]; then
108107
echo "{}" > /etc/sonic/init_cfg.json
109108
fi
110-
redis-cli -n $CONFIG_DB_INDEX FLUSHDB
109+
sonic-db-cli CONFIG_DB FLUSHDB
111110
sonic-cfggen -H -m -j /etc/sonic/init_cfg.json --write-to-db
112-
redis-cli -n $CONFIG_DB_INDEX SET "CONFIG_DB_INITIALIZED" "1"
111+
sonic-db-cli CONFIG_DB SET "CONFIG_DB_INITIALIZED" "1"
113112
if [ -f /etc/sonic/acl.json ]; then
114113
acl-loader update full /etc/sonic/acl.json
115114
fi
@@ -138,7 +137,7 @@ function copy_config_files_and_directories()
138137
# Check if SONiC swich has booted after a warm reboot request
139138
check_system_warm_boot()
140139
{
141-
SYSTEM_WARM_START=`/usr/bin/redis-cli -n 6 hget "WARM_RESTART_ENABLE_TABLE|system" enable`
140+
SYSTEM_WARM_START=`sonic-db-cli STATE_DB hget "WARM_RESTART_ENABLE_TABLE|system" enable`
142141
# SYSTEM_WARM_START could be empty, always make WARM_BOOT meaningful.
143142
if [[ x"$SYSTEM_WARM_START" == x"true" ]]; then
144143
WARM_BOOT="true"
@@ -187,7 +186,7 @@ load_config()
187186
return 1
188187
fi
189188

190-
redis-cli -n $CONFIG_DB_INDEX FLUSHDB
189+
sonic-db-cli CONFIG_DB FLUSHDB
191190
sonic-cfggen -j ${CONFIG_FILE} --write-to-db
192191
if [ $? -ne 0 ]; then
193192
return $?
@@ -198,7 +197,7 @@ load_config()
198197
/usr/bin/db_migrator.py -o migrate
199198
fi
200199

201-
redis-cli -n $CONFIG_DB_INDEX SET "CONFIG_DB_INITIALIZED" "1"
200+
sonic-db-cli CONFIG_DB SET "CONFIG_DB_INITIALIZED" "1"
202201
return 0
203202
}
204203

files/image_config/updategraph/updategraph

+4-6
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
11
#!/bin/bash
22

3-
CONFIG_DB_INDEX=4
4-
53
reload_minigraph()
64
{
75
echo "Reloading minigraph..."
86
if [ ! -f /etc/sonic/init_cfg.json ]; then
97
echo "{}" > /etc/sonic/init_cfg.json
108
fi
11-
redis-cli -n $CONFIG_DB_INDEX FLUSHDB
9+
sonic-db-cli CONFIG_DB FLUSHDB
1210
sonic-cfggen -H -m -j /etc/sonic/init_cfg.json --write-to-db
13-
redis-cli -n $CONFIG_DB_INDEX SET "CONFIG_DB_INITIALIZED" "1"
11+
sonic-db-cli CONFIG_DB SET "CONFIG_DB_INITIALIZED" "1"
1412
if [ -f /etc/sonic/acl.json ]; then
1513
acl-loader update full /etc/sonic/acl.json
1614
fi
@@ -77,9 +75,9 @@ if [ "$src" = "dhcp" ]; then
7775
else
7876
cp -f /tmp/device_meta.json /etc/sonic/config_db.json
7977
fi
80-
redis-cli -n $CONFIG_DB_INDEX FLUSHDB
78+
sonic-db-cli CONFIG_DB FLUSHDB
8179
sonic-cfggen -j /etc/sonic/config_db.json --write-to-db
82-
redis-cli -n $CONFIG_DB_INDEX SET "CONFIG_DB_INITIALIZED" "1"
80+
sonic-db-cli CONFIG_DB SET "CONFIG_DB_INITIALIZED" "1"
8381
if [ "$dhcp_as_static" = "true" ]; then
8482
sed -i "/enabled=/d" /etc/sonic/updategraph.conf
8583
echo "enabled=false" >> /etc/sonic/updategraph.conf

files/image_config/warmboot-finalizer/finalize-warmboot.sh

+4-6
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ function debug()
2020

2121
function check_warm_boot()
2222
{
23-
WARM_BOOT=`/usr/bin/redis-cli -n 6 hget "WARM_RESTART_ENABLE_TABLE|system" enable`
23+
WARM_BOOT=`sonic-db-cli STATE_DB hget "WARM_RESTART_ENABLE_TABLE|system" enable`
2424
}
2525

2626

@@ -29,12 +29,10 @@ function wait_for_database_service()
2929
debug "Wait for database to become ready..."
3030

3131
# Wait for redis server start before database clean
32-
until [[ $(/usr/bin/docker exec database redis-cli ping | grep -c PONG) -gt 0 ]];
33-
do sleep 1;
34-
done
32+
/usr/bin/docker exec database ping_pong_db_insts
3533

3634
# Wait for configDB initialization
37-
until [[ $(/usr/bin/docker exec database redis-cli -n 4 GET "CONFIG_DB_INITIALIZED") ]];
35+
until [[ $(sonic-db-cli CONFIG_DB GET "CONFIG_DB_INITIALIZED") ]];
3836
do sleep 1;
3937
done
4038

@@ -44,7 +42,7 @@ function wait_for_database_service()
4442

4543
function get_component_state()
4644
{
47-
/usr/bin/redis-cli -n 6 hget "WARM_RESTART_TABLE|$1" state
45+
sonic-db-cli STATE_DB hget "WARM_RESTART_TABLE|$1" state
4846
}
4947

5048

files/scripts/configdb-load.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ if [ -r /etc/sonic/config_db.json ]; then
1010
sonic-cfggen -j /etc/sonic/config_db.json --write-to-db
1111
fi
1212

13-
redis-cli -n 4 SET "CONFIG_DB_INITIALIZED" "1"
13+
sonic-db-cli CONFIG_DB SET "CONFIG_DB_INITIALIZED" "1"

files/scripts/swss.sh

+12-14
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ function unlock_service_state_change()
3131

3232
function check_warm_boot()
3333
{
34-
SYSTEM_WARM_START=`/usr/bin/redis-cli -n 6 hget "WARM_RESTART_ENABLE_TABLE|system" enable`
35-
SERVICE_WARM_START=`/usr/bin/redis-cli -n 6 hget "WARM_RESTART_ENABLE_TABLE|${SERVICE}" enable`
34+
SYSTEM_WARM_START=`sonic-db-cli STATE_DB hget "WARM_RESTART_ENABLE_TABLE|system" enable`
35+
SERVICE_WARM_START=`sonic-db-cli STATE_DB hget "WARM_RESTART_ENABLE_TABLE|${SERVICE}" enable`
3636
if [[ x"$SYSTEM_WARM_START" == x"true" ]] || [[ x"$SERVICE_WARM_START" == x"true" ]]; then
3737
WARM_BOOT="true"
3838
else
@@ -43,7 +43,7 @@ function check_warm_boot()
4343
function validate_restore_count()
4444
{
4545
if [[ x"$WARM_BOOT" == x"true" ]]; then
46-
RESTORE_COUNT=`/usr/bin/redis-cli -n 6 hget "WARM_RESTART_TABLE|orchagent" restore_count`
46+
RESTORE_COUNT=`sonic-db-cli STATE_DB hget "WARM_RESTART_TABLE|orchagent" restore_count`
4747
# We have to make sure db data has not been flushed.
4848
if [[ -z "$RESTORE_COUNT" ]]; then
4949
WARM_BOOT="false"
@@ -54,12 +54,10 @@ function validate_restore_count()
5454
function wait_for_database_service()
5555
{
5656
# Wait for redis server start before database clean
57-
until [[ $(/usr/bin/docker exec database redis-cli ping | grep -c PONG) -gt 0 ]];
58-
do sleep 1;
59-
done
57+
/usr/bin/docker exec database ping_pong_db_insts
6058

6159
# Wait for configDB initialization
62-
until [[ $(/usr/bin/docker exec database redis-cli -n 4 GET "CONFIG_DB_INITIALIZED") ]];
60+
until [[ $(sonic-db-cli CONFIG_DB GET "CONFIG_DB_INITIALIZED") ]];
6361
do sleep 1;
6462
done
6563
}
@@ -69,7 +67,7 @@ function wait_for_database_service()
6967
# $2 the string of a list of table prefixes
7068
function clean_up_tables()
7169
{
72-
redis-cli -n $1 EVAL "
70+
sonic-db-cli $1 EVAL "
7371
local tables = {$2}
7472
for i = 1, table.getn(tables) do
7573
local matches = redis.call('KEYS', tables[i])
@@ -114,11 +112,11 @@ start() {
114112
# Don't flush DB during warm boot
115113
if [[ x"$WARM_BOOT" != x"true" ]]; then
116114
debug "Flushing APP, ASIC, COUNTER, CONFIG, and partial STATE databases ..."
117-
/usr/bin/docker exec database redis-cli -n 0 FLUSHDB
118-
/usr/bin/docker exec database redis-cli -n 1 FLUSHDB
119-
/usr/bin/docker exec database redis-cli -n 2 FLUSHDB
120-
/usr/bin/docker exec database redis-cli -n 5 FLUSHDB
121-
clean_up_tables 6 "'PORT_TABLE*', 'MGMT_PORT_TABLE*', 'VLAN_TABLE*', 'VLAN_MEMBER_TABLE*', 'LAG_TABLE*', 'LAG_MEMBER_TABLE*', 'INTERFACE_TABLE*', 'MIRROR_SESSION*', 'VRF_TABLE*', 'FDB_TABLE*'"
115+
sonic-db-cli APPL_DB FLUSHDB
116+
sonic-db-cli ASIC_DB FLUSHDB
117+
sonic-db-cli COUNTERS_DB FLUSHDB
118+
sonic-db-cli FLEX_COUNTER_DB FLUSHDB
119+
clean_up_tables STATE_DB "'PORT_TABLE*', 'MGMT_PORT_TABLE*', 'VLAN_TABLE*', 'VLAN_MEMBER_TABLE*', 'LAG_TABLE*', 'LAG_MEMBER_TABLE*', 'INTERFACE_TABLE*', 'MIRROR_SESSION*', 'VRF_TABLE*', 'FDB_TABLE*'"
122120
fi
123121

124122
# start service docker
@@ -166,7 +164,7 @@ stop() {
166164
# encountered error, e.g. syncd crashed. And swss needs to
167165
# be restarted.
168166
debug "Clearing FAST_REBOOT flag..."
169-
clean_up_tables 6 "'FAST_REBOOT*'"
167+
clean_up_tables STATE_DB "'FAST_REBOOT*'"
170168

171169
# Unlock has to happen before reaching out to peer service
172170
unlock_service_state_change

files/scripts/syncd.sh

+5-7
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ function unlock_service_state_change()
3030

3131
function check_warm_boot()
3232
{
33-
SYSTEM_WARM_START=`/usr/bin/redis-cli -n 6 hget "WARM_RESTART_ENABLE_TABLE|system" enable`
34-
SERVICE_WARM_START=`/usr/bin/redis-cli -n 6 hget "WARM_RESTART_ENABLE_TABLE|${SERVICE}" enable`
33+
SYSTEM_WARM_START=`sonic-db-cli STATE_DB hget "WARM_RESTART_ENABLE_TABLE|system" enable`
34+
SERVICE_WARM_START=`sonic-db-cli STATE_DB hget "WARM_RESTART_ENABLE_TABLE|${SERVICE}" enable`
3535
# SYSTEM_WARM_START could be empty, always make WARM_BOOT meaningful.
3636
if [[ x"$SYSTEM_WARM_START" == x"true" ]] || [[ x"$SERVICE_WARM_START" == x"true" ]]; then
3737
WARM_BOOT="true"
@@ -43,12 +43,10 @@ function check_warm_boot()
4343
function wait_for_database_service()
4444
{
4545
# Wait for redis server start before database clean
46-
until [[ $(/usr/bin/docker exec database redis-cli ping | grep -c PONG) -gt 0 ]];
47-
do sleep 1;
48-
done
46+
/usr/bin/docker exec database ping_pong_db_insts
4947

5048
# Wait for configDB initialization
51-
until [[ $(/usr/bin/docker exec database redis-cli -n 4 GET "CONFIG_DB_INITIALIZED") ]];
49+
until [[ $(sonic-db-cli CONFIG_DB GET "CONFIG_DB_INITIALIZED") ]];
5250
do sleep 1;
5351
done
5452
}
@@ -65,7 +63,7 @@ function getBootType()
6563
;;
6664
*SONIC_BOOT_TYPE=fast*|*fast-reboot*)
6765
# check that the key exists
68-
if [[ $(redis-cli -n 6 GET "FAST_REBOOT|system") == "1" ]]; then
66+
if [[ $(sonic-db-cli STATE_DB GET "FAST_REBOOT|system") == "1" ]]; then
6967
TYPE='fast'
7068
else
7169
TYPE='cold'

platform/barefoot/sonic-platform-modules-ingrasys/s9180-32x/utils/qsfp_monitor.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ function _docker_swss_check {
6565
while true
6666
do
6767
# Check if syncd starts
68-
result=`docker exec -i swss bash -c "echo -en \"SELECT 1\\nHLEN HIDDEN\" | redis-cli | sed -n 2p"` #TBD FIX ME
68+
result=`sonic-db-cli ASIC_DB HLEN HIDDEN`
6969
if [ "$result" == "3" ]; then
7070
return
7171
fi

platform/barefoot/sonic-platform-modules-ingrasys/s9280-64x/utils/qsfp_monitor.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ function _docker_swss_check {
6666
while true
6767
do
6868
# Check if syncd starts
69-
result=`docker exec -i swss bash -c "echo -en \"SELECT 1\\nHLEN HIDDEN\" | redis-cli | sed -n 2p"` #TBD FIX ME
69+
result=`sonic-db-cli ASIC_DB HLEN HIDDEN`
7070
if [ "$result" == "3" ]; then
7171
return
7272
fi

platform/broadcom/sonic-platform-modules-ingrasys/s8810-32q/utils/qsfp_monitor.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ function _docker_swss_check {
6565
while true
6666
do
6767
# Check if syncd starts
68-
result=`docker exec -i swss bash -c "echo -en \"SELECT 1\\nHLEN HIDDEN\" | redis-cli | sed -n 2p"` #TBD FIX ME
68+
result=`sonic-db-cli ASIC_DB HLEN HIDDEN`
6969
if [ "$result" == "3" ]; then
7070
return
7171
fi

platform/broadcom/sonic-platform-modules-ingrasys/s8900-54xc/utils/qsfp_monitor.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ function _docker_swss_check {
6767
while true
6868
do
6969
# Check if syncd starts
70-
result=`docker exec -i swss bash -c "echo -en \"SELECT 1\\nHLEN HIDDEN\" | redis-cli | sed -n 2p"` #TBD FIX ME
70+
result=`sonic-db-cli ASIC_DB HLEN HIDDEN`
7171
if [ "$result" == "3" ]; then
7272
return
7373
fi

platform/broadcom/sonic-platform-modules-ingrasys/s8900-64xc/utils/qsfp_monitor.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ function _docker_swss_check {
6767
while true
6868
do
6969
# Check if syncd starts
70-
result=`docker exec -i swss bash -c "echo -en \"SELECT 1\\nHLEN HIDDEN\" | redis-cli | sed -n 2p"` #TBD FIX ME
70+
result=`sonic-db-cli ASIC_DB HLEN HIDDEN`
7171
if [ "$result" == "3" ]; then
7272
return
7373
fi

platform/broadcom/sonic-platform-modules-ingrasys/s9100/utils/qsfp_monitor.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ function _docker_swss_check {
6565
while true
6666
do
6767
# Check if syncd starts
68-
result=`docker exec -i swss bash -c "echo -en \"SELECT 1\\nHLEN HIDDEN\" | redis-cli | sed -n 2p"` #TBD FIX ME
68+
result=`sonic-db-cli ASIC_DB HLEN HIDDEN`
6969
if [ "$result" == "3" ]; then
7070
return
7171
fi

platform/broadcom/sonic-platform-modules-ingrasys/s9200-64x/utils/qsfp_monitor.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ function _docker_swss_check {
6666
while true
6767
do
6868
# Check if syncd starts
69-
result=`docker exec -i swss bash -c "echo -en \"SELECT 1\\nHLEN HIDDEN\" | redis-cli | sed -n 2p"` #TBD FIX ME
69+
result=`sonic-db-cli ASIC_DB HLEN HIDDEN`
7070
if [ "$result" == "3" ]; then
7171
return
7272
fi

platform/nephos/sonic-platform-modules-ingrasys/s9130-32x/utils/qsfp_monitor.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ function _docker_swss_check {
6565
while true
6666
do
6767
# Check if syncd starts
68-
result=`docker exec -i swss bash -c "echo -en \"SELECT 1\\nHLEN HIDDEN\" | redis-cli | sed -n 2p"` #TBD FIX ME
68+
result=`sonic-db-cli ASIC_DB HLEN HIDDEN`
6969
if [ "$result" == "3" ]; then
7070
return
7171
fi

platform/nephos/sonic-platform-modules-ingrasys/s9230-64x/utils/qsfp_monitor.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ function _docker_swss_check {
6666
while true
6767
do
6868
# Check if syncd starts
69-
result=`docker exec -i swss bash -c "echo -en \"SELECT 1\\nHLEN HIDDEN\" | redis-cli | sed -n 2p"` #TBD FIX ME
69+
result=`sonic-db-cli ASIC_DB HLEN HIDDEN`
7070
if [ "$result" == "3" ]; then
7171
return
7272
fi

0 commit comments

Comments
 (0)