Skip to content
This repository was archived by the owner on May 3, 2024. It is now read-only.

Commit ec58f23

Browse files
committed
CORTX-30751: Codacy code cleanup (#1606)
This patch fixes some of the codacy warnings. warning fixed : "Double quote to prevent globing and words splitting". Signed-off-by: alfhad <[email protected]>
1 parent 882a3a0 commit ec58f23

File tree

1 file changed

+33
-33
lines changed

1 file changed

+33
-33
lines changed

spiel/st/m0t1fs_spiel_sns_common_inc.sh

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@
2121
M0_SRC_DIR=`readlink -f $0`
2222
M0_SRC_DIR=${M0_SRC_DIR%/*/*/*}
2323

24-
. $M0_SRC_DIR/utils/functions # die, sandbox_init, report_and_exit
25-
. $M0_SRC_DIR/m0t1fs/linux_kernel/st/common.sh
26-
. $M0_SRC_DIR/m0t1fs/linux_kernel/st/m0t1fs_common_inc.sh
27-
. $M0_SRC_DIR/m0t1fs/linux_kernel/st/m0t1fs_client_inc.sh
28-
. $M0_SRC_DIR/m0t1fs/linux_kernel/st/m0t1fs_server_inc.sh
29-
. $M0_SRC_DIR/m0t1fs/linux_kernel/st/common_service_fids_inc.sh
30-
. $M0_SRC_DIR/m0t1fs/linux_kernel/st/m0t1fs_sns_common_inc.sh
24+
. "$M0_SRC_DIR"/utils/functions # die, sandbox_init, report_and_exit
25+
. "$M0_SRC_DIR"/m0t1fs/linux_kernel/st/common.sh
26+
. "$M0_SRC_DIR"/m0t1fs/linux_kernel/st/m0t1fs_common_inc.sh
27+
. "$M0_SRC_DIR"/m0t1fs/linux_kernel/st/m0t1fs_client_inc.sh
28+
. "$M0_SRC_DIR"/m0t1fs/linux_kernel/st/m0t1fs_server_inc.sh
29+
. "$M0_SRC_DIR"/m0t1fs/linux_kernel/st/common_service_fids_inc.sh
30+
. "$M0_SRC_DIR"/m0t1fs/linux_kernel/st/m0t1fs_sns_common_inc.sh
3131

3232
###################################################
3333
# SNS repair is only supported in COPYTOOL mode,
@@ -91,8 +91,8 @@ verify()
9191
{
9292
echo "verifying ..."
9393
for ((i=0; i < ${#files[*]}; i++)) ; do
94-
local_read $((${unit_size[$i]} * 1024)) ${file_size[$i]} || return $?
95-
read_and_verify ${files[$i]} $((${unit_size[$i]} * 1024)) ${file_size[$i]} || return $?
94+
local_read $((${unit_size[$i]} * 1024)) "${file_size[$i]}" || return $?
95+
read_and_verify "${files[$i]}" $((${unit_size[$i]} * 1024)) "${file_size[$i]}" || return $?
9696
done
9797

9898
echo "file verification sucess"
@@ -131,28 +131,28 @@ spiel_prepare()
131131
export SPIEL_OPTS=$SPIEL_OPTS
132132
export SPIEL_FIDS_LIST=$SPIEL_FIDS_LIST
133133

134-
echo SPIEL_OPTS=$SPIEL_OPTS
135-
echo SPIEL_FIDS_LIST=$SPIEL_FIDS_LIST
134+
echo SPIEL_OPTS="$SPIEL_OPTS"
135+
echo SPIEL_FIDS_LIST="$SPIEL_FIDS_LIST"
136136

137137
# install "motr" Python module required by m0spiel tool
138-
cd $M0_SRC_DIR/utils/spiel
138+
cd "$M0_SRC_DIR"/utils/spiel
139139
python3 setup.py install --record $PYTHON_STUFF > /dev/null ||\
140140
die 'Cannot install Python "motr" module'
141141
cd -
142142
}
143143

144144
spiel_cleanup()
145145
{
146-
cd $M0_SRC_DIR/utils/spiel
146+
cd "$M0_SRC_DIR"/utils/spiel
147147
cat $PYTHON_STUFF | xargs rm -rf
148148
rm -rf build/ $PYTHON_STUFF
149149
cd -
150150
}
151151

152152
spiel_sns_repair_start()
153153
{
154-
echo $M0_SRC_DIR/utils/spiel/m0spiel $SPIEL_OPTS
155-
$M0_SRC_DIR/utils/spiel/m0spiel $SPIEL_OPTS <<EOF
154+
echo "$M0_SRC_DIR"/utils/spiel/m0spiel "$SPIEL_OPTS"
155+
"$M0_SRC_DIR"/utils/spiel/m0spiel "$SPIEL_OPTS" <<EOF
156156
$SPIEL_FIDS_LIST
157157
158158
$SPIEL_RCONF_START
@@ -166,8 +166,8 @@ EOF
166166

167167
spiel_sns_repair_abort()
168168
{
169-
echo $M0_SRC_DIR/utils/spiel/m0spiel $SPIEL_OPTS
170-
$M0_SRC_DIR/utils/spiel/m0spiel $SPIEL_OPTS <<EOF
169+
echo "$M0_SRC_DIR"/utils/spiel/m0spiel "$SPIEL_OPTS"
170+
"$M0_SRC_DIR"/utils/spiel/m0spiel "$SPIEL_OPTS" <<EOF
171171
$SPIEL_FIDS_LIST
172172
173173
$SPIEL_RCONF_START
@@ -181,8 +181,8 @@ EOF
181181

182182
spiel_sns_repair_quiesce()
183183
{
184-
echo $M0_SRC_DIR/utils/spiel/m0spiel $SPIEL_OPTS
185-
$M0_SRC_DIR/utils/spiel/m0spiel $SPIEL_OPTS <<EOF
184+
echo "$M0_SRC_DIR"/utils/spiel/m0spiel "$SPIEL_OPTS"
185+
"$M0_SRC_DIR"/utils/spiel/m0spiel "$SPIEL_OPTS" <<EOF
186186
$SPIEL_FIDS_LIST
187187
188188
$SPIEL_RCONF_START
@@ -196,8 +196,8 @@ EOF
196196

197197
spiel_sns_repair_continue()
198198
{
199-
echo $M0_SRC_DIR/utils/spiel/m0spiel $SPIEL_OPTS
200-
$M0_SRC_DIR/utils/spiel/m0spiel $SPIEL_OPTS <<EOF
199+
echo "$M0_SRC_DIR"/utils/spiel/m0spiel "$SPIEL_OPTS"
200+
"$M0_SRC_DIR"/utils/spiel/m0spiel "$SPIEL_OPTS" <<EOF
201201
$SPIEL_FIDS_LIST
202202
203203
$SPIEL_RCONF_START
@@ -211,8 +211,8 @@ EOF
211211

212212
spiel_wait_for_sns_repair()
213213
{
214-
echo $M0_SRC_DIR/utils/spiel/m0spiel $SPIEL_OPTS
215-
$M0_SRC_DIR/utils/spiel/m0spiel $SPIEL_OPTS <<EOF
214+
echo "$M0_SRC_DIR"/utils/spiel/m0spiel "$SPIEL_OPTS"
215+
"$M0_SRC_DIR"/utils/spiel/m0spiel "$SPIEL_OPTS" <<EOF
216216
import time
217217
$SPIEL_FIDS_LIST
218218
@@ -240,8 +240,8 @@ EOF
240240

241241
spiel_sns_rebalance_start()
242242
{
243-
echo $M0_SRC_DIR/utils/spiel/m0spiel $SPIEL_OPTS
244-
$M0_SRC_DIR/utils/spiel/m0spiel $SPIEL_OPTS <<EOF
243+
echo "$M0_SRC_DIR"/utils/spiel/m0spiel "$SPIEL_OPTS"
244+
"$M0_SRC_DIR"/utils/spiel/m0spiel "$SPIEL_OPTS" <<EOF
245245
$SPIEL_FIDS_LIST
246246
247247
$SPIEL_RCONF_START
@@ -255,8 +255,8 @@ EOF
255255

256256
spiel_sns_rebalance_quiesce()
257257
{
258-
echo $M0_SRC_DIR/utils/spiel/m0spiel $SPIEL_OPTS
259-
$M0_SRC_DIR/utils/spiel/m0spiel $SPIEL_OPTS <<EOF
258+
echo "$M0_SRC_DIR"/utils/spiel/m0spiel "$SPIEL_OPTS"
259+
"$M0_SRC_DIR"/utils/spiel/m0spiel "$SPIEL_OPTS" <<EOF
260260
$SPIEL_FIDS_LIST
261261
262262
$SPIEL_RCONF_START
@@ -270,8 +270,8 @@ EOF
270270

271271
spiel_sns_rebalance_continue()
272272
{
273-
echo $M0_SRC_DIR/utils/spiel/m0spiel $SPIEL_OPTS
274-
$M0_SRC_DIR/utils/spiel/m0spiel $SPIEL_OPTS <<EOF
273+
echo "$M0_SRC_DIR"/utils/spiel/m0spiel "$SPIEL_OPTS"
274+
"$M0_SRC_DIR"/utils/spiel/m0spiel "$SPIEL_OPTS" <<EOF
275275
$SPIEL_FIDS_LIST
276276
277277
$SPIEL_RCONF_START
@@ -285,8 +285,8 @@ EOF
285285

286286
spiel_wait_for_sns_rebalance()
287287
{
288-
echo $M0_SRC_DIR/utils/spiel/m0spiel $SPIEL_OPTS
289-
$M0_SRC_DIR/utils/spiel/m0spiel $SPIEL_OPTS <<EOF
288+
echo "$M0_SRC_DIR"/utils/spiel/m0spiel "$SPIEL_OPTS"
289+
"$M0_SRC_DIR"/utils/spiel/m0spiel "$SPIEL_OPTS" <<EOF
290290
import time
291291
$SPIEL_FIDS_LIST
292292
@@ -314,8 +314,8 @@ EOF
314314

315315
spiel_sns_rebalance_abort()
316316
{
317-
echo $M0_SRC_DIR/utils/spiel/m0spiel $SPIEL_OPTS
318-
$M0_SRC_DIR/utils/spiel/m0spiel $SPIEL_OPTS <<EOF
317+
echo "$M0_SRC_DIR"/utils/spiel/m0spiel "$SPIEL_OPTS"
318+
"$M0_SRC_DIR"/utils/spiel/m0spiel "$SPIEL_OPTS" <<EOF
319319
$SPIEL_FIDS_LIST
320320
321321
$SPIEL_RCONF_START

0 commit comments

Comments
 (0)