Browse code

a-space-after-then/do compliance.

Chmouel Boudjnah authored on 2011/11/14 23:26:13
Showing 1 changed files
... ...
@@ -377,38 +377,38 @@ function get_packages() {
377 377
     
378 378
     for service in ${ENABLED_SERVICES//,/ }; do
379 379
         if [[ $service == n-* ]]; then
380
-            if [[ ! $file_to_parse =~ nova ]];then
380
+            if [[ ! $file_to_parse =~ nova ]]; then
381 381
                 file_to_parse="${file_to_parse} nova"
382 382
             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
385 385
                 file_to_parse="${file_to_parse} glance"
386 386
             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
389 389
                 file_to_parse="${file_to_parse} keystone"
390 390
             fi
391
-        elif [[ -e $FILES/apts/${service} ]];then
391
+        elif [[ -e $FILES/apts/${service} ]]; then
392 392
             file_to_parse="${file_to_parse} $service"
393 393
         fi
394 394
     done
395 395
 
396
-    for file in ${file_to_parse};do
396
+    for file in ${file_to_parse}; do
397 397
         local fname=${FILES}/apts/${file}
398 398
         local OIFS line package distros distro
399 399
         [[ -e $fname ]] || { echo "missing: $fname"; exit 1 ;}
400 400
 
401 401
         OIFS=$IFS
402 402
         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
405 405
                 continue
406 406
             fi
407 407
 
408
-            if [[ $line =~ (.*)#.*dist:([^ ]*) ]];then # We are using BASH regexp matching feature.
408
+            if [[ $line =~ (.*)#.*dist:([^ ]*) ]]; then # We are using BASH regexp matching feature.
409 409
                         package=${BASH_REMATCH[1]}
410 410
                         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
412 412
                             [[ ${distro,,} == ${DISTRO,,} ]] && echo $package
413 413
                         done
414 414
                         continue
... ...
@@ -710,7 +710,7 @@ if [[ "$ENABLED_SERVICES" =~ "swift" ]]; then
710 710
     sudo chown -R $USER:${USER_GROUP} ${SWIFT_DATA_LOCATION}/drives
711 711
 
712 712
     # 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
714 714
         mkdir -p  ${SWIFT_DATA_LOCATION}/drives/images
715 715
         sudo touch  ${SWIFT_DATA_LOCATION}/drives/images/swift.img
716 716
         sudo chown $USER: ${SWIFT_DATA_LOCATION}/drives/images/swift.img
... ...
@@ -723,7 +723,7 @@ if [[ "$ENABLED_SERVICES" =~ "swift" ]]; then
723 723
     # After the drive being created we mount the disk with a few mount
724 724
     # options to make it most efficient as possible for swift.
725 725
     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
727 727
         sudo mount -t xfs -o loop,noatime,nodiratime,nobarrier,logbufs=8  \
728 728
             ${SWIFT_DATA_LOCATION}/drives/images/swift.img ${SWIFT_DATA_LOCATION}/drives/sdb1
729 729
     fi
... ...
@@ -737,7 +737,7 @@ if [[ "$ENABLED_SERVICES" =~ "swift" ]]; then
737 737
     tmpd=""
738 738
     for d in ${SWIFT_DATA_LOCATION}/drives/sdb1/{1..4} \
739 739
         ${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
741 741
         [[ -d $d ]] && continue
742 742
         sudo install -o ${USER} -g $USER_GROUP -d $d
743 743
     done
... ...
@@ -786,7 +786,7 @@ if [[ "$ENABLED_SERVICES" =~ "swift" ]]; then
786 786
        local log_facility=$3
787 787
        local node_number
788 788
 
789
-       for node_number in {1..4};do
789
+       for node_number in {1..4}; do
790 790
            node_path=${SWIFT_DATA_LOCATION}/${node_number}
791 791
            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}," \
792 792
                $FILES/swift/${server_type}-server.conf > ${SWIFT_CONFIG_LOCATION}/${server_type}-server/${node_number}.conf