Fix shellcheck errors for LBaaS apps

Current patch fixes shell issues in LBaaS apps reported by test run:
tox -e shellcheck
All LB related scripts were fixed according command output.

Change-Id: Ia24f2ba25d7818cb05d064a9fc7f5f4617f714d8
This commit is contained in:
Sergey Kraynev 2016-08-01 15:12:45 +03:00
parent b963bcb61a
commit 9bed165c30
9 changed files with 36 additions and 23 deletions

View File

@ -1,3 +1,5 @@
#!/bin/bash
# Stop the script if an error occurs.
set -e
@ -5,12 +7,12 @@ set -e
cd releases/jobs;
pushd lbaas-config
tar zcvf lbaas-config.tgz *;
tar zcvf lbaas-config.tgz ./*;
mv lbaas-config.tgz ../
popd
pushd delete-lbaas
tar zcvf delete-lbaas.tgz *;
tar zcvf delete-lbaas.tgz ./*;
mv delete-lbaas.tgz ../
popd
@ -27,7 +29,7 @@ pushd python/python
popd
pushd python
tar zcvf python.tgz *;
tar zcvf python.tgz ./*;
mv python.tgz ../
popd
@ -69,7 +71,7 @@ sed -i -e "s/%sha1_delete_lbaas_job%/${sha1_delete_lbaas_job}/g" tmp/releases/re
# Pack the release.
cd tmp/releases;
tar zcvf example-release-10.tgz *;
tar zcvf example-release-10.tgz ./*;
cd ../..
# Enable option 'extended globbing' for easy deletion.
@ -80,7 +82,7 @@ rm -rf tmp/releases/!(example-release-10.tgz)
# Pack tile.
cd tmp;
zip -r lbaas-tile.zip *;
zip -r lbaas-tile.zip ./*;
cd ..
mv tmp/lbaas-tile.zip .

View File

@ -1,11 +1,13 @@
#!/bin/bash
host=$1
pem_file=$2
pkey_path=$3
echo $host
echo $pem_file
echo $pkey_path
echo "$host"
echo "$pem_file"
echo "$pkey_path"
scp -o StrictHostKeyChecking=no -i $pkey_path $pem_file ec2-user@$host:~/
scp -o StrictHostKeyChecking=no -i "$pkey_path" "$pem_file" "ec2-user@$host:~/"
ssh -o StrictHostKeyChecking=no -i $pkey_path ec2-user@$host "sudo mv ~/cf.pem /etc/ssl/"
ssh -o StrictHostKeyChecking=no -i "$pkey_path" "ec2-user@$host" "sudo mv ~/cf.pem /etc/ssl/"

View File

@ -1,14 +1,16 @@
#!/bin/bash
# Stop the script if an error occurs.
set -e
function cleanup {
cd $SCRIPTPATH
cd "$SCRIPTPATH"
rm -rf tmp
}
# In case if script is running not where it is located.
cd $(dirname $0)
SCRIPTPATH=`pwd`
cd "$(dirname "$0")"
SCRIPTPATH=$(pwd)
# Cleanup tmp dir on script exit.
trap 'cleanup' EXIT

View File

@ -1,3 +1,5 @@
#!/bin/bash
# Fail script if an error occurs.
set -e
# TODO(nmakhotkin): It should be removed in the future after fixing the bug:

View File

@ -1,3 +1,5 @@
#!/bin/bash
sudo add-apt-repository ppa:vbernat/haproxy-1.5 -y
sudo apt-get update
@ -6,7 +8,7 @@ sudo apt-get install -y haproxy
# Enabling HAProxy.
sudo sed -i 's/^ENABLED=.*/ENABLED=1/' /etc/default/haproxy
sudo chown -R $USER:$USER /etc/haproxy
sudo chown -R "$USER:$USER" /etc/haproxy
# Starting HAProxy.
#sudo service haproxy restart

View File

@ -20,8 +20,8 @@ sudo pip install lbaas.tar.gz
sudo pip install mysql-python
sudo mkdir /etc/lbaas
sudo chown -R $USER:$USER /etc/lbaas
sudo chown -R $USER:$USER /var/log/lbaas.log
sudo chown -R "$USER:$USER" /etc/lbaas
sudo chown -R "$USER:$USER" /var/log/lbaas.log
# Moving config to another place.
cp lbaas.conf.sample /etc/lbaas/lbaas.conf

View File

@ -1,7 +1,6 @@
#!/bin/bash
tools_path=${tools_path:-$(dirname $0)}
tools_path=${tools_path:-$(dirname "$0")}
venv_path=${venv_path:-${tools_path}}
venv_dir=${venv_name:-/../.venv}
TOOLS=${tools_path}
VENV=${venv:-${venv_path}/${venv_dir}}
source ${VENV}/bin/activate && "$@"
source "${VENV}/bin/activate" && "$@"

View File

@ -1,14 +1,16 @@
#!/bin/bash
# Stop the script if an error occurs.
set -e
function cleanup {
cd $SCRIPTPATH
cd "$SCRIPTPATH"
rm -rf tmp
}
# In case if script is running not where it is located.
cd $(dirname $0)
SCRIPTPATH=`pwd`
cd "$(dirname "$0")"
SCRIPTPATH=$(pwd)
# Cleanup tmp dir on script exit.
trap 'cleanup' EXIT

View File

@ -1,3 +1,5 @@
#!/bin/bash
sudo add-apt-repository ppa:vbernat/haproxy-1.5 -y
sudo apt-get update
@ -6,7 +8,7 @@ sudo apt-get install -y haproxy
# Enabling HAProxy.
sudo sed -i 's/^ENABLED=.*/ENABLED=1/' /etc/default/haproxy
sudo chown -R $USER:$USER /etc/haproxy
sudo chown -R "$USER:$USER" /etc/haproxy
# Starting HAProxy.
#sudo service haproxy restart