Skip to content

Commit 46799b6

Browse files
committed
Fix shellcheck failures in bootstrap.sh and create_block.sh
1 parent b1829df commit 46799b6

File tree

3 files changed

+9
-11
lines changed

3 files changed

+9
-11
lines changed

hack/.shellcheck_failures

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,6 @@
107107
./test/images/volume/gluster/run_gluster.sh
108108
./test/images/volume/iscsi/create_block.sh
109109
./test/images/volume/nfs/run_nfs.sh
110-
./test/images/volume/rbd/bootstrap.sh
111-
./test/images/volume/rbd/create_block.sh
112110
./third_party/forked/shell2junit/sh2ju.sh
113111
./third_party/intemp/intemp.sh
114112
./third_party/multiarch/qemu-user-static/register/qemu-binfmt-conf.sh

test/images/volume/rbd/bootstrap.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@
2525

2626

2727
# Create /etc/ceph/ceph.conf
28-
sh ./ceph.conf.sh `hostname -i`
28+
sh ./ceph.conf.sh "$(hostname -i)"
2929

3030
# Configure and start ceph-mon
31-
sh ./mon.sh `hostname -i`
31+
sh ./mon.sh "$(hostname -i)"
3232

3333
# Configure and start 2x ceph-osd
3434
mkdir -p /var/lib/ceph/osd/ceph-0 /var/lib/ceph/osd/ceph-1
@@ -51,7 +51,7 @@ ceph fs new cephfs cephfs_metadata cephfs_data
5151
# It takes a while until the volume created above is mountable,
5252
# 1 second is usually enough, but try indefinetily.
5353
sleep 1
54-
while ! ceph-fuse -m `hostname -i`:6789 /mnt; do
54+
while ! ceph-fuse -m "$(hostname -i):6789" /mnt; do
5555
echo "Waiting for cephfs to be up"
5656
sleep 1
5757
done

test/images/volume/rbd/create_block.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,16 @@
2020
# Exit on the first error.
2121
set -e
2222

23-
MNTDIR=`mktemp -d`
23+
MNTDIR="$(mktemp -d)"
2424

2525
cleanup()
2626
{
2727
# Make sure we return the right exit code
2828
RET=$?
2929
# Silently remove everything and ignore errors
3030
set +e
31-
/bin/umount $MNTDIR 2>/dev/null
32-
/bin/rmdir $MNTDIR 2>/dev/null
31+
/bin/umount "$MNTDIR" 2>/dev/null
32+
/bin/rmdir "$MNTDIR" 2>/dev/null
3333
/bin/rm block 2>/dev/null
3434
exit $RET
3535
}
@@ -42,9 +42,9 @@ dd if=/dev/zero of=block seek=120 count=1 bs=1M
4242
mkfs.ext2 block
4343

4444
# Add index.html to it
45-
mount -o loop block $MNTDIR
46-
echo "Hello from RBD" > $MNTDIR/index.html
47-
umount $MNTDIR
45+
mount -o loop block "$MNTDIR"
46+
echo "Hello from RBD" > "$MNTDIR/index.html"
47+
umount "$MNTDIR"
4848

4949
rm block.tar.gz 2>/dev/null || :
5050
tar cfz block.tar.gz block

0 commit comments

Comments
 (0)