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

Commit 1286c72

Browse files
authored
CORTX-30751: Codacy code cleanup (#1606) (#1899)
This patch fixes some of the codacy warnings. warning fixed : "Double quote to prevent globing and words splitting". Signed-off-by: Alfhad <[email protected]> Signed-off-by: Rinku Kothiya <[email protected]>
1 parent 5834994 commit 1286c72

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

st/m0d-device-detach-test.sh

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,13 @@ M0_SRC_DIR=${M0_SRC_DIR%/*/*}
3131
# Number of test iterations
3232
ITER_NR=10
3333

34-
. $M0_SRC_DIR/utils/functions # report_and_exit
34+
. "$M0_SRC_DIR"/utils/functions # report_and_exit
3535

3636
# install "motr" Python module required by m0spiel tool
37-
cd $M0_SRC_DIR/utils/spiel
37+
cd "$M0_SRC_DIR"/utils/spiel
3838
python3 setup.py install > /dev/null ||
3939
die 'Cannot install Python "motr" module'
40-
cd $M0_SRC_DIR
40+
cd "$M0_SRC_DIR"
4141

4242
echo "Installing Motr services"
4343
scripts/install-motr-service -u
@@ -59,7 +59,7 @@ systemctl start motr-singlenode
5959
sleep 10 # allow motr to finish its startup
6060

6161
echo "Perform device-detach test"
62-
cd $SANDBOX_DIR
62+
cd "$SANDBOX_DIR"
6363

6464
LNET_NID=`lctl list_nids | head -1`
6565
SPIEL_ENDPOINT="$LNET_NID:12345:34:1021"
@@ -68,7 +68,7 @@ M0_SPIEL_OPTS="-l $M0_SRC_DIR/motr/.libs/libmotr.so --client $SPIEL_ENDPOINT \
6868
--ha $HA_ENDPOINT"
6969

7070
function spiel_cmd {
71-
$M0_SRC_DIR/utils/spiel/m0spiel $M0_SPIEL_OPTS <<EOF
71+
"$M0_SRC_DIR"/utils/spiel/m0spiel $M0_SPIEL_OPTS <<EOF
7272
fids = {'profile' : Fid(0x7000000000000001, 0),
7373
'disk0' : Fid(0x6b00000000000001, 2)
7474
}
@@ -99,11 +99,11 @@ rc=0
9999
for I in $(seq 1 $ITER_NR); do
100100
filename="/mnt/m0t1fs/1:$I"
101101
echo "Iteration $I of $ITER_NR (file: $filename)"
102-
touch $filename && setfattr -n lid -v 8 $filename
102+
touch "$filename" && setfattr -n lid -v 8 "$filename"
103103
rc=$?
104104
if [ $rc -ne 0 ]; then echo "Cannot create file"; break; fi
105105
echo "Start I/O"
106-
dd if=/dev/zero of=$filename bs=1M count=10 >/dev/null 2>&1 &
106+
dd if=/dev/zero of="$filename" bs=1M count=10 >/dev/null 2>&1 &
107107
dd_pid=$!
108108

109109
spiel_cmd device_detach
@@ -129,12 +129,12 @@ if [ $rc -eq 0 ]; then
129129
rc=$motr_rc
130130
fi
131131

132-
cd $M0_SRC_DIR
132+
cd "$M0_SRC_DIR"
133133
scripts/install-motr-service -u
134134
utils/m0setup -v -P 3 -N 1 -K 1 -S 1 -i 1 -d /var/motr/img -s 8 -c
135135

136136
if [ $rc -eq 0 ]; then
137-
rm -r $SANDBOX_DIR
137+
rm -r "$SANDBOX_DIR"
138138
fi
139139

140140
report_and_exit m0d-device-detach $rc

0 commit comments

Comments
 (0)