indent using 4 spaces (2/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:
 - nagios3
 - network-utils
 - neutron-openvswitch
 - nova-api
 - nova-baremetal
 - nova-compute
 - nova-kvm
 - openstack-client
 - openstack-db
 - openstack-ssl

Change-Id: I489746d384c0c2c5a4f2b12444606e3bf8e3ce11
This commit is contained in:
Gonéri Le Bouder 2014-05-11 01:40:09 +02:00
parent 45ff3c1a87
commit e73cbc8e2b
11 changed files with 50 additions and 50 deletions

View File

@ -7,7 +7,7 @@ install-packages nagios3
sed -i "s/check_external_commands=0/check_external_commands=1/" /etc/nagios3/nagios.cfg sed -i "s/check_external_commands=0/check_external_commands=1/" /etc/nagios3/nagios.cfg
# fix a minior display issue # fix a minior display issue
if [ -f /etc/nagios3/conf.d/extinfo_nagios2.cfg ]; then if [ -f /etc/nagios3/conf.d/extinfo_nagios2.cfg ]; then
sed -i "s/base\/debian/debian/g" /etc/nagios3/conf.d/extinfo_nagios2.cfg sed -i "s/base\/debian/debian/g" /etc/nagios3/conf.d/extinfo_nagios2.cfg
fi fi
# set all servers as having ssh # set all servers as having ssh
sed -i '0,/ssh-servers/! s/localhost/*/' /etc/nagios3/conf.d/hostgroups_nagios2.cfg sed -i '0,/ssh-servers/! s/localhost/*/' /etc/nagios3/conf.d/hostgroups_nagios2.cfg

View File

@ -48,7 +48,7 @@ BOOTPROTO=none
HOTPLUG=no HOTPLUG=no
EOF_CAT EOF_CAT
#bridge config #bridge config
if [ -z "$bridge_ip_addr" ]; then if [ -z "$bridge_ip_addr" ]; then
cat > $tmp_bridge_config <<EOF_CAT cat > $tmp_bridge_config <<EOF_CAT
DEVICE=$bridge DEVICE=$bridge
@ -105,7 +105,7 @@ function configure_bridge_interface_dhcp_eni() {
sed -e "/auto $interface*/,/^$/d" -i $tmp_config sed -e "/auto $interface*/,/^$/d" -i $tmp_config
sed -e "/auto $bridge*/,/^$/d" -i $tmp_config sed -e "/auto $bridge*/,/^$/d" -i $tmp_config
#interface config #interface config
cat >> $tmp_config <<-EOF_CAT cat >> $tmp_config <<-EOF_CAT
auto $interface auto $interface
allow-$bridge $interface allow-$bridge $interface
@ -114,7 +114,7 @@ allow-$bridge $interface
ovs_type OVSPort ovs_type OVSPort
EOF_CAT EOF_CAT
#bridge config #bridge config
if [ -z "$bridge_ip_addr" ]; then if [ -z "$bridge_ip_addr" ]; then
cat >> $tmp_config <<EOF_CAT cat >> $tmp_config <<EOF_CAT
auto $bridge auto $bridge
@ -172,11 +172,11 @@ fi
if [ -n "$PUBLIC_INTERFACE_ROUTE" ]; then if [ -n "$PUBLIC_INTERFACE_ROUTE" ]; then
DEFAULT_VIA=$(ip route show | awk '/default / { print $3 }') DEFAULT_VIA=$(ip route show | awk '/default / { print $3 }')
if [ "$DEFAULT_VIA" != "$PUBLIC_INTERFACE_ROUTE" ]; then if [ "$DEFAULT_VIA" != "$PUBLIC_INTERFACE_ROUTE" ]; then
if [ -z "$(ip route show 169.254.169.254)" ]; then if [ -z "$(ip route show 169.254.169.254)" ]; then
# No explicit route to 169.254.169.254 - set one. # No explicit route to 169.254.169.254 - set one.
ip route add 169.254.169.254/32 via $DEFAULT_VIA ip route add 169.254.169.254/32 via $DEFAULT_VIA
fi fi
ip route prepend dev $EXTERNAL_BRIDGE default via $PUBLIC_INTERFACE_ROUTE ip route prepend dev $EXTERNAL_BRIDGE default via $PUBLIC_INTERFACE_ROUTE
ip route del default via $DEFAULT_VIA ip route del default via $DEFAULT_VIA
fi fi
fi fi

View File

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

View File

@ -34,12 +34,12 @@ PHYSICAL_INTERFACE_RAW_DEVICE=$(os-apply-config --key neutron.ovs.public_interfa
PUBLIC_INTERFACE_ROUTE=$(os-apply-config --key neutron.ovs.public_interface_route --type netaddress --key-default '') PUBLIC_INTERFACE_ROUTE=$(os-apply-config --key neutron.ovs.public_interface_route --type netaddress --key-default '')
if [ -n "$PHYSICAL_INTERFACE_RAW_DEVICE" ]; then if [ -n "$PHYSICAL_INTERFACE_RAW_DEVICE" ]; then
if ! (ip link show dev $PHYSICAL_INTERFACE) ; then if ! (ip link show dev $PHYSICAL_INTERFACE) ; then
VLAN_ID=$(echo $PHYSICAL_INTERFACE | sed s/vlan//) VLAN_ID=$(echo $PHYSICAL_INTERFACE | sed s/vlan//)
vconfig set_name_type VLAN_PLUS_VID_NO_PAD vconfig set_name_type VLAN_PLUS_VID_NO_PAD
vconfig add $PHYSICAL_INTERFACE_RAW_DEVICE $VLAN_ID vconfig add $PHYSICAL_INTERFACE_RAW_DEVICE $VLAN_ID
fi fi
ip link set $PHYSICAL_INTERFACE up ip link set $PHYSICAL_INTERFACE up
fi fi
# NOTE: ensure-bridge actually takes care of this now but it # NOTE: ensure-bridge actually takes care of this now but it

View File

@ -4,9 +4,9 @@ set -eux
TEMPLATE_ROOT=$(dirname $0)/../os-apply-config TEMPLATE_ROOT=$(dirname $0)/../os-apply-config
get_additional_config(){ get_additional_config(){
if [ -e ${TEMPLATE_ROOT}/etc/nova/nova-${1}.conf ]; then if [ -e ${TEMPLATE_ROOT}/etc/nova/nova-${1}.conf ]; then
echo "--config-file /etc/nova/nova.conf --config-file /etc/nova/nova-${1}.conf" echo "--config-file /etc/nova/nova.conf --config-file /etc/nova/nova-${1}.conf"
fi fi
} }
NOVA_COMPONENTS="api cert scheduler consoleauth conductor" NOVA_COMPONENTS="api cert scheduler consoleauth conductor"

View File

@ -5,12 +5,12 @@ install-packages syslinux tftpd-hpa xinetd
mkdir -p /tftpboot/pxelinux.cfg/ mkdir -p /tftpboot/pxelinux.cfg/
if [ -f /usr/lib/syslinux/pxelinux.0 ]; then if [ -f /usr/lib/syslinux/pxelinux.0 ]; then
cp /usr/lib/syslinux/pxelinux.0 /tftpboot/ # Ubuntu cp /usr/lib/syslinux/pxelinux.0 /tftpboot/ # Ubuntu
elif [ -f /usr/share/syslinux/pxelinux.0 ]; then elif [ -f /usr/share/syslinux/pxelinux.0 ]; then
cp /usr/share/syslinux/pxelinux.0 /tftpboot/ # Fedora/RHEL cp /usr/share/syslinux/pxelinux.0 /tftpboot/ # Fedora/RHEL
else else
echo "Failed to find pxelinux.0." echo "Failed to find pxelinux.0."
exit 1 exit 1
fi fi
# Disable the tftp-hpa upstart job, we're using xinetd # Disable the tftp-hpa upstart job, we're using xinetd

View File

@ -10,7 +10,7 @@ CONFIG_PARAMETERS="--config-dir /etc/nova"
TEMPLATE_ROOT=$(dirname $0)/../os-apply-config TEMPLATE_ROOT=$(dirname $0)/../os-apply-config
if [ -e ${TEMPLATE_ROOT}/etc/nova/nova-compute.conf ]; then if [ -e ${TEMPLATE_ROOT}/etc/nova/nova-compute.conf ]; then
CONFIG_PARAMETERS="${CONFIG_PARAMETERS} --config-file /etc/nova/nova.conf --config-file /etc/nova/nova-compute.conf" CONFIG_PARAMETERS="${CONFIG_PARAMETERS} --config-file /etc/nova/nova.conf --config-file /etc/nova/nova-compute.conf"
fi fi
os-svc-daemon -i "$NOVA_VENV_DIR" -e "LIBVIRT_DEFAULT_URI=qemu:///system" nova-compute nova nova-compute "${CONFIG_PARAMETERS}" os-svc-daemon -i "$NOVA_VENV_DIR" -e "LIBVIRT_DEFAULT_URI=qemu:///system" nova-compute nova nova-compute "${CONFIG_PARAMETERS}"
@ -19,6 +19,6 @@ os-svc-daemon -i "$NOVA_VENV_DIR" -e "LIBVIRT_DEFAULT_URI=qemu:///system" nova-c
# Use the rootwrap config from the source repo. # Use the rootwrap config from the source repo.
install -o root -g root -m 0755 -d /etc/nova/rootwrap.d install -o root -g root -m 0755 -d /etc/nova/rootwrap.d
for f in $(ls /opt/stack/nova/etc/nova/rootwrap.d/); do for f in $(ls /opt/stack/nova/etc/nova/rootwrap.d/); do
install -o root -g root -m 644 /opt/stack/nova/etc/nova/rootwrap.d/$f /etc/nova/rootwrap.d/$f install -o root -g root -m 644 /opt/stack/nova/etc/nova/rootwrap.d/$f /etc/nova/rootwrap.d/$f
done done
install -o root -g root -m 0644 /opt/stack/nova/etc/nova/rootwrap.conf /etc/nova/rootwrap.conf install -o root -g root -m 0644 /opt/stack/nova/etc/nova/rootwrap.conf /etc/nova/rootwrap.conf

View File

@ -6,7 +6,7 @@ install-packages libvirt-bin python-libvirt kvm pm-utils kpartx
# Fedora don't always have the libvirtd group created # Fedora don't always have the libvirtd group created
if ! grep ^libvirtd /etc/group > /dev/null 2>&1; then if ! grep ^libvirtd /etc/group > /dev/null 2>&1; then
groupadd -f libvirtd groupadd -f libvirtd
fi fi
usermod -a -G libvirtd nova usermod -a -G libvirtd nova

View File

@ -3,13 +3,13 @@
set -eux set -eux
function usage() { function usage() {
echo "options:" echo "options:"
echo " -h show usage and exit" echo " -h show usage and exit"
echo " -c client bin name" echo " -c client bin name"
echo " -i Optional: installation directory for the virtualenv." echo " -i Optional: installation directory for the virtualenv."
echo " If not specified defaults to /opt/stack/venv/python-<client name>client" echo " If not specified defaults to /opt/stack/venv/python-<client name>client"
echo " -s enable --system-site-packages in the virtualenv." echo " -s enable --system-site-packages in the virtualenv."
exit $1 exit $1
} }
client="" client=""
@ -30,8 +30,8 @@ while getopts "hsi:c:" opt; do
done done
if [[ -z "$client" ]]; then if [[ -z "$client" ]]; then
echo "missing required 'client' parameter" echo "missing required 'client' parameter"
exit 1 exit 1
fi fi
repo=python-${client}client repo=python-${client}client
@ -58,20 +58,20 @@ set -u
pushd /opt/stack/$repo pushd /opt/stack/$repo
client_manifest=$(get-pip-manifest ${repo}) client_manifest=$(get-pip-manifest ${repo})
if [ -n "$client_manifest" ]; then if [ -n "$client_manifest" ]; then
use-pip-manifest $client_manifest use-pip-manifest $client_manifest
else else
# Need setuptools>=1.0 to manage connections when # Need setuptools>=1.0 to manage connections when
# downloading from pypi using http_proxy and https_proxy # downloading from pypi using http_proxy and https_proxy
pip install -U 'setuptools>=1.0' pip install -U 'setuptools>=1.0'
# bug #1293812 : Avoid easy_install triggering on pbr. # bug #1293812 : Avoid easy_install triggering on pbr.
pip install -U 'pbr>=0.5.21,<1.0' pip install -U 'pbr>=0.5.21,<1.0'
if [ -e requirements.txt ]; then if [ -e requirements.txt ]; then
pip install -r requirements.txt pip install -r requirements.txt
elif [ -e tools/pip-requires ]; then elif [ -e tools/pip-requires ]; then
pip install -r tools/pip-requires pip install -r tools/pip-requires
fi fi
fi fi
# Always replay this, as we cannot use the entry this would generate in the manifest # Always replay this, as we cannot use the entry this would generate in the manifest

View File

@ -5,9 +5,9 @@ install-packages mysql-server python-mysqldb
my_cnf= my_cnf=
if [ -f /etc/mysql/my.cnf ]; then if [ -f /etc/mysql/my.cnf ]; then
my_cnf=/etc/mysql/my.cnf # Ubuntu my_cnf=/etc/mysql/my.cnf # Ubuntu
elif [ -f /etc/my.cnf ]; then elif [ -f /etc/my.cnf ]; then
my_cnf=/etc/my.cnf # Fedora/RHEL my_cnf=/etc/my.cnf # Fedora/RHEL
fi fi
sed -i 's/127.0.0.1/0.0.0.0/g' $my_cnf sed -i 's/127.0.0.1/0.0.0.0/g' $my_cnf

View File

@ -22,7 +22,7 @@ install-packages stunnel4
# Debian/Ubuntu don't install stunnel4 in a working configuration. # Debian/Ubuntu don't install stunnel4 in a working configuration.
if [ -e /etc/default/stunnel4 ]; then if [ -e /etc/default/stunnel4 ]; then
cat > /etc/default/stunnel4 << EOF cat > /etc/default/stunnel4 << EOF
ENABLED=1 ENABLED=1
FILES="/etc/stunnel/*.conf" FILES="/etc/stunnel/*.conf"
OPTIONS="" OPTIONS=""