Skip to content

Commit f990ded

Browse files
committed
a-space-after-then/do compliance.
1 parent 0277d5b commit f990ded

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

stack.sh

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -377,38 +377,38 @@ function get_packages() {
377377

378378
for service in ${ENABLED_SERVICES//,/ }; do
379379
if [[ $service == n-* ]]; then
380-
if [[ ! $file_to_parse =~ nova ]];then
380+
if [[ ! $file_to_parse =~ nova ]]; then
381381
file_to_parse="${file_to_parse} nova"
382382
fi
383-
elif [[ $service == g-* ]];then
384-
if [[ ! $file_to_parse =~ glance ]];then
383+
elif [[ $service == g-* ]]; then
384+
if [[ ! $file_to_parse =~ glance ]]; then
385385
file_to_parse="${file_to_parse} glance"
386386
fi
387-
elif [[ $service == key* ]];then
388-
if [[ ! $file_to_parse =~ keystone ]];then
387+
elif [[ $service == key* ]]; then
388+
if [[ ! $file_to_parse =~ keystone ]]; then
389389
file_to_parse="${file_to_parse} keystone"
390390
fi
391-
elif [[ -e $FILES/apts/${service} ]];then
391+
elif [[ -e $FILES/apts/${service} ]]; then
392392
file_to_parse="${file_to_parse} $service"
393393
fi
394394
done
395395

396-
for file in ${file_to_parse};do
396+
for file in ${file_to_parse}; do
397397
local fname=${FILES}/apts/${file}
398398
local OIFS line package distros distro
399399
[[ -e $fname ]] || { echo "missing: $fname"; exit 1 ;}
400400

401401
OIFS=$IFS
402402
IFS=$'\n'
403-
for line in $(cat ${fname});do
404-
if [[ $line =~ "NOPRIME" ]];then
403+
for line in $(cat ${fname}); do
404+
if [[ $line =~ "NOPRIME" ]]; then
405405
continue
406406
fi
407407

408-
if [[ $line =~ (.*)#.*dist:([^ ]*) ]];then # We are using BASH regexp matching feature.
408+
if [[ $line =~ (.*)#.*dist:([^ ]*) ]]; then # We are using BASH regexp matching feature.
409409
package=${BASH_REMATCH[1]}
410410
distros=${BASH_REMATCH[2]}
411-
for distro in ${distros//,/ };do #In bash ${VAR,,} will lowecase VAR
411+
for distro in ${distros//,/ }; do #In bash ${VAR,,} will lowecase VAR
412412
[[ ${distro,,} == ${DISTRO,,} ]] && echo $package
413413
done
414414
continue
@@ -710,7 +710,7 @@ if [[ "$ENABLED_SERVICES" =~ "swift" ]]; then
710710
sudo chown -R $USER:${USER_GROUP} ${SWIFT_DATA_LOCATION}/drives
711711

712712
# We then create a loopback disk and format it to XFS.
713-
if [[ ! -e ${SWIFT_DATA_LOCATION}/drives/images/swift.img ]];then
713+
if [[ ! -e ${SWIFT_DATA_LOCATION}/drives/images/swift.img ]]; then
714714
mkdir -p ${SWIFT_DATA_LOCATION}/drives/images
715715
sudo touch ${SWIFT_DATA_LOCATION}/drives/images/swift.img
716716
sudo chown $USER: ${SWIFT_DATA_LOCATION}/drives/images/swift.img
@@ -723,7 +723,7 @@ if [[ "$ENABLED_SERVICES" =~ "swift" ]]; then
723723
# After the drive being created we mount the disk with a few mount
724724
# options to make it most efficient as possible for swift.
725725
mkdir -p ${SWIFT_DATA_LOCATION}/drives/sdb1
726-
if ! egrep -q ${SWIFT_DATA_LOCATION}/drives/sdb1 /proc/mounts;then
726+
if ! egrep -q ${SWIFT_DATA_LOCATION}/drives/sdb1 /proc/mounts; then
727727
sudo mount -t xfs -o loop,noatime,nodiratime,nobarrier,logbufs=8 \
728728
${SWIFT_DATA_LOCATION}/drives/images/swift.img ${SWIFT_DATA_LOCATION}/drives/sdb1
729729
fi
@@ -737,7 +737,7 @@ if [[ "$ENABLED_SERVICES" =~ "swift" ]]; then
737737
tmpd=""
738738
for d in ${SWIFT_DATA_LOCATION}/drives/sdb1/{1..4} \
739739
${SWIFT_CONFIG_LOCATION}/{object,container,account}-server \
740-
${SWIFT_DATA_LOCATION}/{1..4}/node/sdb1 /var/run/swift ;do
740+
${SWIFT_DATA_LOCATION}/{1..4}/node/sdb1 /var/run/swift; do
741741
[[ -d $d ]] && continue
742742
sudo install -o ${USER} -g $USER_GROUP -d $d
743743
done
@@ -786,7 +786,7 @@ if [[ "$ENABLED_SERVICES" =~ "swift" ]]; then
786786
local log_facility=$3
787787
local node_number
788788

789-
for node_number in {1..4};do
789+
for node_number in {1..4}; do
790790
node_path=${SWIFT_DATA_LOCATION}/${node_number}
791791
sed -e "s,%SWIFT_CONFIG_LOCATION%,${SWIFT_CONFIG_LOCATION},;s,%USER%,$USER,;s,%NODE_PATH%,${node_path},;s,%BIND_PORT%,${bind_port},;s,%LOG_FACILITY%,${log_facility}," \
792792
$FILES/swift/${server_type}-server.conf > ${SWIFT_CONFIG_LOCATION}/${server_type}-server/${node_number}.conf

0 commit comments

Comments
 (0)