indent using 4 spaces (1/3)

As advised in I072cf8bf6748d0c910fecffdf2282bcc4656d038, code should
use 4 spaces for indentation.

This commit enforces the use of 4 spaces indentation.
In order to simplify the review process, this patch only cover the
following elements:
 - bm-dnsmasq,
 - boot-stack,
 - cinder-volume
 - devstack
 - haproxy
 - keepalived
 - mariadb
 - mariadb-dev
 - memcached
 - mysql-common
 - mysql

Change-Id: I7932fd24e72f7585e24ad3e0213f42361e668f7c
This commit is contained in:
Gonéri Le Bouder 2014-05-11 01:19:16 +02:00
parent e0cdbd38fa
commit b349e39077
14 changed files with 75 additions and 75 deletions

View File

@ -16,7 +16,7 @@ iptables -X FILTERBOOTPSNEW || true
iptables -N FILTERBOOTPSNEW
# Build the chain we want.
for MAC in $MACS; do
iptables -A FILTERBOOTPSNEW -m mac --mac-source $MAC -j ACCEPT
iptables -A FILTERBOOTPSNEW -m mac --mac-source $MAC -j ACCEPT
done
# Drop rather than reject as this is a broadcast protocol: we'd just be
# creating noise on the network.

View File

@ -3,8 +3,8 @@ set -eux
install-packages dnsmasq dnsmasq-utils
function install_dnsmasq_upstart {
cat > /etc/init/nova-bm-dnsmasq.conf << eof
function install_dnsmasq_upstart() {
cat > /etc/init/nova-bm-dnsmasq.conf << eof
start on runlevel [2345]
stop on runlevel [016]
pre-start script
@ -30,8 +30,8 @@ post-start exec sleep 1
eof
}
function install_dnsmasq_systemd {
cat > /lib/systemd/system/nova-bm-dnsmasq.service << eof
function install_dnsmasq_systemd() {
cat > /lib/systemd/system/nova-bm-dnsmasq.service << eof
[Unit]
Description=Nova dnsmasq service
After=openvswitch.service
@ -54,13 +54,13 @@ WantedBy=multi-user.target
Alias=nova-bm-dnsmasq.service
eof
# Enable the service
systemctl enable nova-bm-dnsmasq.service
# Enable the service
systemctl enable nova-bm-dnsmasq.service
}
if [ "$DIB_INIT_SYSTEM" == "upstart" ]; then
install_dnsmasq_upstart
install_dnsmasq_upstart
elif [ "$DIB_INIT_SYSTEM" == "systemd" ]; then
install_dnsmasq_systemd
install_dnsmasq_systemd
fi

View File

@ -2,8 +2,8 @@
set -eu
if [[ $EUID -ne 0 ]]; then
echo "ERROR: you must be root to run this" 1>&2
exit 1
echo "ERROR: you must be root to run this" 1>&2
exit 1
fi
scr_name=os-logs
@ -17,11 +17,11 @@ caption always "%{-b ..}%-w%{+b ..}[[%n%f*%t]]%{-}%+w"
eof
for f in \
/var/log/upstart/nova-compute.log \
/var/log/upstart/nova-scheduler.log; do
if [ -e $f ]; then
echo "screen -t $(basename $f) sh -c \"tail -f $f | ccze\"" >> $scr_file
fi
/var/log/upstart/nova-compute.log \
/var/log/upstart/nova-scheduler.log; do
if [ -e $f ]; then
echo "screen -t $(basename $f) sh -c \"tail -f $f | ccze\"" >> $scr_file
fi
done
# XXX: Note that this is obsolete if the Neutron DHCP agent is in use.

View File

@ -11,18 +11,18 @@ db_pass=$(os-apply-config --key db-password)
STATEDIR=/mnt/state/var/lib/mysql
DONE=${STATEDIR}/db.initialized
if [ -e ${DONE} ] ; then
echo "DB files already initialized."
echo "DB files already initialized."
else
for FILE in ibdata1 ib_logfile0 ib_logfile1 ; do
for FILE in ibdata1 ib_logfile0 ib_logfile1 ; do
if [ -e $STATEDIR/$FILE ] ; then
mv $STATEDIR/$FILE $STATEDIR/$FILE.bak
mv $STATEDIR/$FILE $STATEDIR/$FILE.bak
fi
done
# Sometimes packages make the files ownership wrong
chown -R mysql.mysql ${STATEDIR}
touch ${DONE}
done
# Sometimes packages make the files ownership wrong
chown -R mysql.mysql ${STATEDIR}
touch ${DONE}
os-svc-restart -n mysql
os-svc-restart -n mysql
fi
PATH=/usr/local/bin:$PATH

View File

@ -7,20 +7,20 @@ install -m 0755 -o root -g root -d /opt/stack/boot-stack
# tools
for f in `ls $(dirname $0)/../bin`; do
install -m 0755 -o root -g root $(dirname $0)/../bin/$f /usr/local/bin/$f
install -m 0755 -o root -g root $(dirname $0)/../bin/$f /usr/local/bin/$f
done
# db
install-packages python-mysqldb
function deps {
if hash apt-get &> /dev/null; then
apt-get update
fi
install-packages screen ccze
install-packages git ipmitool python-dev python-greenlet libxml2-dev libxslt-dev
install-packages openvswitch-common openvswitch-switch open-iscsi
install-packages python-numpy python-lxml
function deps() {
if hash apt-get &> /dev/null; then
apt-get update
fi
install-packages screen ccze
install-packages git ipmitool python-dev python-greenlet libxml2-dev libxslt-dev
install-packages openvswitch-common openvswitch-switch open-iscsi
install-packages python-numpy python-lxml
}
deps

View File

@ -12,21 +12,21 @@ vol_file=/mnt/state/var/lib/cinder/${vol_group}-backing-file
size=$(os-apply-config --key cinder.volume_size_mb --type int)M
if ! vgs $vol_group; then
if ! [ -f $vol_file ] ; then
truncate -s $size $vol_file
fi
dev=$(losetup -j $vol_file)
# RACE: will be unstable if other things are running. o-r-c has a
# lock though so only manual runners of this script should make it unstable
if [ -z "$dev" ] ; then
dev=$(sudo losetup -f --show $vol_file)
fi
# This file is fairly complex and platform dependent. However, we need to
# accept only this device or volumes created within cinder could be
# added to this volume group erroneously.
# Note that this will likely break any other element trying to use LVM.
sed --in-place=.bak -e \
"s|^\(\s*\)filter = \[.*|\1filter = [ \"a\|^${dev}\|\", \"r/.*/\" ]|" \
/etc/lvm/lvm.conf
if ! vgs $vol_group; then vgcreate $vol_group $dev; fi
if ! [ -f $vol_file ] ; then
truncate -s $size $vol_file
fi
dev=$(losetup -j $vol_file)
# RACE: will be unstable if other things are running. o-r-c has a
# lock though so only manual runners of this script should make it unstable
if [ -z "$dev" ] ; then
dev=$(sudo losetup -f --show $vol_file)
fi
# This file is fairly complex and platform dependent. However, we need to
# accept only this device or volumes created within cinder could be
# added to this volume group erroneously.
# Note that this will likely break any other element trying to use LVM.
sed --in-place=.bak -e \
"s|^\(\s*\)filter = \[.*|\1filter = [ \"a\|^${dev}\|\", \"r/.*/\" ]|" \
/etc/lvm/lvm.conf
if ! vgs $vol_group; then vgcreate $vol_group $dev; fi
fi

View File

@ -4,5 +4,5 @@
set -e
if (( '16' '>' $DIB_IMAGE_SIZE )); then
echo DIB_IMAGE_SIZE=16
echo DIB_IMAGE_SIZE=16
fi

View File

@ -7,10 +7,10 @@ install-packages haproxy
[ -d /var/lib/haproxy ] || install -d -D -m 0755 -o root -g root /var/lib/haproxy
if [ "$DIB_INIT_SYSTEM" == "systemd" ] ; then
systemctl enable haproxy.service
systemctl enable haproxy.service
fi
# haproxy service has to be explicitly enabled in /etc/default/haproxy on ubuntu/debian systems
if [ -f /etc/default/haproxy ]; then
sed -i -e 's/ENABLED=0/ENABLED=1/' /etc/default/haproxy
sed -i -e 's/ENABLED=0/ENABLED=1/' /etc/default/haproxy
fi

View File

@ -5,5 +5,5 @@ set -eux
install-packages keepalived
if [ "$DIB_INIT_SYSTEM" == "systemd" ] ; then
systemctl enable keepalived.service
systemctl enable keepalived.service
fi

View File

@ -31,7 +31,7 @@ register-state-path /var/log/mysql
# for mysql and mariadb and for i386/amd64
[ -e /usr/local/mysql/lib ] || install -m 0755 -o root -g root -d /usr/local/mysql/lib
if [ -e /usr/lib64/galera/libgalera_smm.so ];then
ln -sf /usr/lib64/galera/libgalera_smm.so /usr/local/mysql/lib/libgalera_smm.so
ln -sf /usr/lib64/galera/libgalera_smm.so /usr/local/mysql/lib/libgalera_smm.so
elif [ -e /usr/lib/galera/libgalera_smm.so ];then
ln -sf /usr/lib/galera/libgalera_smm.so /usr/local/mysql/lib/libgalera_smm.so
ln -sf /usr/lib/galera/libgalera_smm.so /usr/local/mysql/lib/libgalera_smm.so
fi

View File

@ -8,5 +8,5 @@ install-packages libmariadb-dev
# https://mariadb.atlassian.net/browse/MDEV-5793
FILE=$(which mysql_config)
if $FILE --libs_r | grep probes_mysql;then
sed -i.orig "s/-lprobes_mysql//" $FILE
sed -i.orig "s/-lprobes_mysql//" $FILE
fi

View File

@ -17,37 +17,37 @@ set -o xtrace
DISTRO=`lsb_release -si` || true
if [ "$DISTRO" == "RedHatEnterpriseServer" ];then
DIST_DIR="rhel"
DIST_DIR="rhel"
else
DIST_DIR=$(echo "$DISTRO"|tr A-Z a-z)
DIST_DIR=$(echo "$DISTRO"|tr A-Z a-z)
fi
function add_yum_repo() {
ver=`lsb_release -sr`
ver=`lsb_release -sr`
cat > /etc/yum.repos.d/mariadb.repo <<eof
cat > /etc/yum.repos.d/mariadb.repo <<eof
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/5.5/$DIST_DIR$ver-$MARIADB_ARCH
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
eof
rpmkeys --import https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
rpmkeys --import https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
}
function add_apt_repo() {
local codename=`lsb_release -sc`
# http://keyserver.ubuntu.com is used both for debian and ubuntu
apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xcbcb082a1bb943db
add-apt-repository "deb http://mariadb.mirror.iweb.com//repo/5.5/$DIST_DIR $codename main"
apt-get update
local codename=`lsb_release -sc`
# http://keyserver.ubuntu.com is used both for debian and ubuntu
apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xcbcb082a1bb943db
add-apt-repository "deb http://mariadb.mirror.iweb.com//repo/5.5/$DIST_DIR $codename main"
apt-get update
}
if [[ "RedHatEnterpriseServer CentOS Fedora" =~ "$DISTRO" ]]; then
add_yum_repo
add_yum_repo
elif [[ "Ubuntu Debian" =~ "$DISTRO" ]]; then
add_apt_repo
add_apt_repo
else
echo "Distribution '$DISTRO' is not supported"
exit 1
echo "Distribution '$DISTRO' is not supported"
exit 1
fi

View File

@ -5,5 +5,5 @@ set -eux
install-packages memcached
if [ "$DIB_INIT_SYSTEM" == "systemd" ] ; then
systemctl enable memcached.service
systemctl enable memcached.service
fi

View File

@ -53,7 +53,7 @@ register-state-path --leave-symlink /var/log/mysql
DISTRO=`lsb_release -si` || true
if [[ "RedHatEnterpriseServer CentOS Fedora" =~ "$DISTRO" ]]; then
# mysql clients on redhat expect the socket at /var/lib/mysql/mysql.sock
mkdir -p /var/lib/mysql
ln -s /var/run/mysqld/mysqld.sock /var/lib/mysql/mysql.sock
# mysql clients on redhat expect the socket at /var/lib/mysql/mysql.sock
mkdir -p /var/lib/mysql
ln -s /var/run/mysqld/mysqld.sock /var/lib/mysql/mysql.sock
fi