Skip to content

Commit d0f07b0

Browse files
committed
Address Review comments
1 parent a4c8ea8 commit d0f07b0

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

files/image_config/config-setup/config-setup

+6-7
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ initalize_configdb()
113113
IP_NETNS_CMD=${IP_NETNS_CMD_PREFIX}${NAMESPACE_PREFIX}$2
114114
fi
115115

116-
if [ "$1" == "init" ]; then
116+
if [[ "$1" == "init" ]]; then
117117
# case when config db need to be created/initialized from minigraph
118118
sonic-db-cli ${NAMESPACE_ARGUMENT} CONFIG_DB FLUSHDB
119119
sonic-cfggen -H -m -j ${INIT_CFG_JSON} ${NAMESPACE_ARGUMENT} --write-to-db
@@ -125,7 +125,7 @@ initalize_configdb()
125125
# this will be run only in per-asic namespace only in multi-npu platforms
126126
${IP_NETNS_CMD} config qos reload
127127
${IP_NETNS_CMD} pfcwd start_default
128-
elif [ "$1" == "reload" ]; then
128+
elif [[ "$1" == "reload" ]]; then
129129
# case when config db is already present from previous image file system
130130
sonic-cfggen ${NAMESPACE_ARGUMENT} -j ${CONFIG_DB_PATH}${CONFIG_DB_PREFIX}$2${CONFIG_DB_SUFFIX} --write-to-db
131131
fi
@@ -135,19 +135,18 @@ initalize_configdb()
135135
configdb_migrator()
136136
{
137137
NAMESPACE_ARGUMENT=''
138-
IP_NETNS_CMD=''
139138
# Create correct argument based on per-asic name space in multi-npu platforms
140139
if [[ $# -eq 2 ]]; then
141140
NAMESPACE_ARGUMENT=${NAMESPACE_OPTION}${NAMESPACE_PREFIX}$2
142141
fi
143142

144-
if [ "$1" == "init" ]; then
143+
if [[ "$1" == "init" ]]; then
145144
# case when config db created/initialized from minigraph need to be migrated
146145
if [[ -x /usr/bin/db_migrator.py ]]; then
147146
# Set latest version number
148147
/usr/bin/db_migrator.py ${NAMESPACE_ARGUMENT} -o set_version
149148
fi
150-
elif [ "$1" == "reload" ]; then
149+
elif [[ "$1" == "reload" ]]; then
151150
# case when config db is already present from previous image file system
152151
# need to be migrated
153152
if [[ -x /usr/bin/db_migrator.py ]]; then
@@ -174,7 +173,7 @@ reload_minigraph()
174173
initalize_configdb init $asic_num
175174
((asic_num = asic_num + 1))
176175
done
177-
if [ -f /etc/sonic/acl.json ]; then
176+
if [[ -f /etc/sonic/acl.json ]]; then
178177
# For acl the acl-loader command takes care for multi-npu platforms
179178
acl-loader update full /etc/sonic/acl.json
180179
fi
@@ -506,7 +505,7 @@ boot_config()
506505
PLATFORM=`sonic-cfggen -H -v DEVICE_METADATA.localhost.platform`
507506
# Parse the device specific asic conf file, if it exists
508507
ASIC_CONF=/usr/share/sonic/device/$PLATFORM/asic.conf
509-
if [ -f "$ASIC_CONF" ]; then
508+
if [[ -f "$ASIC_CONF" ]]; then
510509
source $ASIC_CONF
511510
fi
512511

0 commit comments

Comments
 (0)