Restrict scope of loop control variables to local

Some of the loop control variables are global. This as expected has
lead to corruption of their values, and produced undesired results.
Fix this issue by setting the scope of these variables to local.

Closes Bug: #1523348

Change-Id: I0f5676c5a0b97d3e027a1e7677b4b5a21470913b
This commit is contained in:
Ramana Raja 2015-12-07 12:15:09 +05:30
parent 5b4dd3cc70
commit 28fc5d375f
1 changed files with 3 additions and 0 deletions

View File

@ -75,6 +75,7 @@ function _delete_gluster_shares {
gluster_volumes+=,$(echo $share | cut -d/ -f2);
done
local vol_name
for vol_name in $(echo $gluster_volumes | sed "s/,/ /g"); do
sudo gluster --mode=script volume stop $vol_name
sudo gluster --mode=script volume delete $vol_name
@ -226,6 +227,7 @@ function _create_thin_lv_gluster_vol {
# Format the LV.
local mkfs_result=0
local i
for i in `seq 100`; do
mkfs_result=0
sudo mkfs.xfs -i size=512 /dev/$GLUSTERFS_VG_NAME/$vol_name || mkfs_result=$?
@ -320,6 +322,7 @@ function _configure_manila_glusterfs_native {
# Create four GlusterFS volumes to be used as shares.
_create_thin_lv_pool
local i
for i in `seq 1 20`; do
_create_thin_lv_gluster_vol manila-glusterfs-native-vol-20G-$i 20G
# Configure the volume to use GlusterFS's TLS support required by the