From b349e39077afc573decf54286c492eaf2e705b09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gon=C3=A9ri=20Le=20Bouder?= Date: Sun, 11 May 2014 01:19:16 +0200 Subject: [PATCH] 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 --- elements/bm-dnsmasq/bin/filter-bootps | 2 +- elements/bm-dnsmasq/install.d/81-bm-dnsmasq | 16 ++++----- elements/boot-stack/bin/boot-stack-logs | 14 ++++---- elements/boot-stack/bin/reset-db | 16 ++++----- elements/boot-stack/install.d/01-boot-stack | 18 +++++----- .../72-cinder-resize-volume-groups | 34 +++++++++---------- elements/devstack/block-device-size.d/10-size | 2 +- elements/haproxy/install.d/76-haproxy | 4 +-- elements/keepalived/install.d/76-keepalived | 2 +- elements/mariadb-common/install.d/11-mariadb | 4 +-- elements/mariadb-dev/install.d/03-mariadb-dev | 2 +- .../pre-install.d/05-mysql-mariadb-repo | 28 +++++++-------- elements/memcached/install.d/74-memcached | 2 +- elements/mysql/install.d/10-mysql | 6 ++-- 14 files changed, 75 insertions(+), 75 deletions(-) diff --git a/elements/bm-dnsmasq/bin/filter-bootps b/elements/bm-dnsmasq/bin/filter-bootps index 06eb1ec8a..0e90390c6 100755 --- a/elements/bm-dnsmasq/bin/filter-bootps +++ b/elements/bm-dnsmasq/bin/filter-bootps @@ -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. diff --git a/elements/bm-dnsmasq/install.d/81-bm-dnsmasq b/elements/bm-dnsmasq/install.d/81-bm-dnsmasq index edbd015ab..b17bdfd40 100755 --- a/elements/bm-dnsmasq/install.d/81-bm-dnsmasq +++ b/elements/bm-dnsmasq/install.d/81-bm-dnsmasq @@ -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 diff --git a/elements/boot-stack/bin/boot-stack-logs b/elements/boot-stack/bin/boot-stack-logs index d1d57a1f2..b11605496 100755 --- a/elements/boot-stack/bin/boot-stack-logs +++ b/elements/boot-stack/bin/boot-stack-logs @@ -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. diff --git a/elements/boot-stack/bin/reset-db b/elements/boot-stack/bin/reset-db index e90a85d35..9ab187446 100755 --- a/elements/boot-stack/bin/reset-db +++ b/elements/boot-stack/bin/reset-db @@ -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 diff --git a/elements/boot-stack/install.d/01-boot-stack b/elements/boot-stack/install.d/01-boot-stack index 5efad3efc..94a9c5bb0 100755 --- a/elements/boot-stack/install.d/01-boot-stack +++ b/elements/boot-stack/install.d/01-boot-stack @@ -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 diff --git a/elements/cinder-volume/os-refresh-config/post-configure.d/72-cinder-resize-volume-groups b/elements/cinder-volume/os-refresh-config/post-configure.d/72-cinder-resize-volume-groups index 7966b82b6..2804eaea9 100755 --- a/elements/cinder-volume/os-refresh-config/post-configure.d/72-cinder-resize-volume-groups +++ b/elements/cinder-volume/os-refresh-config/post-configure.d/72-cinder-resize-volume-groups @@ -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 diff --git a/elements/devstack/block-device-size.d/10-size b/elements/devstack/block-device-size.d/10-size index e49639170..d87822154 100755 --- a/elements/devstack/block-device-size.d/10-size +++ b/elements/devstack/block-device-size.d/10-size @@ -4,5 +4,5 @@ set -e if (( '16' '>' $DIB_IMAGE_SIZE )); then - echo DIB_IMAGE_SIZE=16 + echo DIB_IMAGE_SIZE=16 fi diff --git a/elements/haproxy/install.d/76-haproxy b/elements/haproxy/install.d/76-haproxy index 8aa203f22..59c130798 100755 --- a/elements/haproxy/install.d/76-haproxy +++ b/elements/haproxy/install.d/76-haproxy @@ -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 diff --git a/elements/keepalived/install.d/76-keepalived b/elements/keepalived/install.d/76-keepalived index 59156efde..cd8191cc1 100755 --- a/elements/keepalived/install.d/76-keepalived +++ b/elements/keepalived/install.d/76-keepalived @@ -5,5 +5,5 @@ set -eux install-packages keepalived if [ "$DIB_INIT_SYSTEM" == "systemd" ] ; then - systemctl enable keepalived.service + systemctl enable keepalived.service fi diff --git a/elements/mariadb-common/install.d/11-mariadb b/elements/mariadb-common/install.d/11-mariadb index dc6bd7a30..00344396e 100755 --- a/elements/mariadb-common/install.d/11-mariadb +++ b/elements/mariadb-common/install.d/11-mariadb @@ -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 diff --git a/elements/mariadb-dev/install.d/03-mariadb-dev b/elements/mariadb-dev/install.d/03-mariadb-dev index 1fd8b2c90..6728d6370 100755 --- a/elements/mariadb-dev/install.d/03-mariadb-dev +++ b/elements/mariadb-dev/install.d/03-mariadb-dev @@ -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 diff --git a/elements/mariadb-dev/pre-install.d/05-mysql-mariadb-repo b/elements/mariadb-dev/pre-install.d/05-mysql-mariadb-repo index 65bce3c6a..2a31e68a9 100755 --- a/elements/mariadb-dev/pre-install.d/05-mysql-mariadb-repo +++ b/elements/mariadb-dev/pre-install.d/05-mysql-mariadb-repo @@ -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 < /etc/yum.repos.d/mariadb.repo <