Enforce function declaration format in bash8
Check that function calls look like ^function foo {$ in bash8, and fix
all existing failures of that check. Add a note to HACKING.rst
Change-Id: Ic19eecb39e0b20273d1bcd551a42fe400d54e938
diff --git a/lib/neutron_plugins/bigswitch_floodlight b/lib/neutron_plugins/bigswitch_floodlight
index 1e4aa00..4cb0da8 100644
--- a/lib/neutron_plugins/bigswitch_floodlight
+++ b/lib/neutron_plugins/bigswitch_floodlight
@@ -8,15 +8,15 @@
source $TOP_DIR/lib/neutron_plugins/ovs_base
source $TOP_DIR/lib/neutron_thirdparty/bigswitch_floodlight # for third party service specific configuration values
-function neutron_plugin_create_nova_conf() {
+function neutron_plugin_create_nova_conf {
:
}
-function neutron_plugin_install_agent_packages() {
+function neutron_plugin_install_agent_packages {
_neutron_ovs_base_install_agent_packages
}
-function neutron_plugin_configure_common() {
+function neutron_plugin_configure_common {
Q_PLUGIN_CONF_PATH=etc/neutron/plugins/bigswitch
Q_PLUGIN_CONF_FILENAME=restproxy.ini
Q_DB_NAME="restproxy_neutron"
@@ -25,23 +25,23 @@
BS_FL_CONTROLLER_TIMEOUT=${BS_FL_CONTROLLER_TIMEOUT:-10}
}
-function neutron_plugin_configure_debug_command() {
+function neutron_plugin_configure_debug_command {
_neutron_ovs_base_configure_debug_command
}
-function neutron_plugin_configure_dhcp_agent() {
+function neutron_plugin_configure_dhcp_agent {
:
}
-function neutron_plugin_configure_l3_agent() {
+function neutron_plugin_configure_l3_agent {
_neutron_ovs_base_configure_l3_agent
}
-function neutron_plugin_configure_plugin_agent() {
+function neutron_plugin_configure_plugin_agent {
:
}
-function neutron_plugin_configure_service() {
+function neutron_plugin_configure_service {
iniset /$Q_PLUGIN_CONF_FILE restproxy servers $BS_FL_CONTROLLERS_PORT
iniset /$Q_PLUGIN_CONF_FILE restproxy servertimeout $BS_FL_CONTROLLER_TIMEOUT
if [ "$BS_FL_VIF_DRIVER" = "ivs" ]; then
@@ -49,7 +49,7 @@
fi
}
-function neutron_plugin_setup_interface_driver() {
+function neutron_plugin_setup_interface_driver {
local conf_file=$1
if [ "$BS_FL_VIF_DRIVER" = "ivs" ]; then
iniset $conf_file DEFAULT interface_driver neutron.agent.linux.interface.IVSInterfaceDriver
@@ -59,12 +59,12 @@
}
-function has_neutron_plugin_security_group() {
+function has_neutron_plugin_security_group {
# 1 means False here
return 1
}
-function neutron_plugin_check_adv_test_requirements() {
+function neutron_plugin_check_adv_test_requirements {
is_service_enabled q-agt && is_service_enabled q-dhcp && return 0
}
diff --git a/lib/neutron_plugins/brocade b/lib/neutron_plugins/brocade
index 8e18d04..4443fa7 100644
--- a/lib/neutron_plugins/brocade
+++ b/lib/neutron_plugins/brocade
@@ -5,53 +5,53 @@
BRCD_XTRACE=$(set +o | grep xtrace)
set +o xtrace
-function is_neutron_ovs_base_plugin() {
+function is_neutron_ovs_base_plugin {
return 1
}
-function neutron_plugin_create_nova_conf() {
+function neutron_plugin_create_nova_conf {
NOVA_VIF_DRIVER=${NOVA_VIF_DRIVER:-"nova.virt.libvirt.vif.LibvirtGenericVIFDriver"}
}
-function neutron_plugin_install_agent_packages() {
+function neutron_plugin_install_agent_packages {
install_package bridge-utils
}
-function neutron_plugin_configure_common() {
+function neutron_plugin_configure_common {
Q_PLUGIN_CONF_PATH=etc/neutron/plugins/brocade
Q_PLUGIN_CONF_FILENAME=brocade.ini
Q_DB_NAME="brcd_neutron"
Q_PLUGIN_CLASS="neutron.plugins.brocade.NeutronPlugin.BrocadePluginV2"
}
-function neutron_plugin_configure_debug_command() {
+function neutron_plugin_configure_debug_command {
iniset $NEUTRON_TEST_CONFIG_FILE DEFAULT external_network_bridge
}
-function neutron_plugin_configure_dhcp_agent() {
+function neutron_plugin_configure_dhcp_agent {
iniset $Q_DHCP_CONF_FILE DEFAULT dhcp_agent_manager neutron.agent.dhcp_agent.DhcpAgentWithStateReport
}
-function neutron_plugin_configure_l3_agent() {
+function neutron_plugin_configure_l3_agent {
iniset $Q_L3_CONF_FILE DEFAULT external_network_bridge
iniset $Q_L3_CONF_FILE DEFAULT l3_agent_manager neutron.agent.l3_agent.L3NATAgentWithStateReport
}
-function neutron_plugin_configure_plugin_agent() {
+function neutron_plugin_configure_plugin_agent {
AGENT_BINARY="$NEUTRON_BIN_DIR/neutron-linuxbridge-agent"
}
-function neutron_plugin_setup_interface_driver() {
+function neutron_plugin_setup_interface_driver {
local conf_file=$1
iniset $conf_file DEFAULT interface_driver neutron.agent.linux.interface.BridgeInterfaceDriver
}
-function has_neutron_plugin_security_group() {
+function has_neutron_plugin_security_group {
# 0 means True here
return 0
}
-function neutron_plugin_check_adv_test_requirements() {
+function neutron_plugin_check_adv_test_requirements {
is_service_enabled q-agt && is_service_enabled q-dhcp && return 0
}
diff --git a/lib/neutron_plugins/cisco b/lib/neutron_plugins/cisco
index 8948be6..7728eb1 100644
--- a/lib/neutron_plugins/cisco
+++ b/lib/neutron_plugins/cisco
@@ -27,12 +27,12 @@
NCCLIENT_BRANCH=${NCCLIENT_BRANCH:-master}
# This routine put a prefix on an existing function name
-function _prefix_function() {
+function _prefix_function {
declare -F $1 > /dev/null || die "$1 doesn't exist"
eval "$(echo "${2}_${1}()"; declare -f ${1} | tail -n +2)"
}
-function _has_ovs_subplugin() {
+function _has_ovs_subplugin {
local subplugin
for subplugin in ${Q_CISCO_PLUGIN_SUBPLUGINS[@]}; do
if [[ "$subplugin" == "openvswitch" ]]; then
@@ -42,7 +42,7 @@
return 1
}
-function _has_nexus_subplugin() {
+function _has_nexus_subplugin {
local subplugin
for subplugin in ${Q_CISCO_PLUGIN_SUBPLUGINS[@]}; do
if [[ "$subplugin" == "nexus" ]]; then
@@ -52,7 +52,7 @@
return 1
}
-function _has_n1kv_subplugin() {
+function _has_n1kv_subplugin {
local subplugin
for subplugin in ${Q_CISCO_PLUGIN_SUBPLUGINS[@]}; do
if [[ "$subplugin" == "n1kv" ]]; then
@@ -64,7 +64,7 @@
# This routine populates the cisco config file with the information for
# a particular nexus switch
-function _config_switch() {
+function _config_switch {
local cisco_cfg_file=$1
local switch_ip=$2
local username=$3
@@ -99,7 +99,7 @@
_prefix_function has_neutron_plugin_security_group ovs
# Check the version of the installed ncclient package
-function check_ncclient_version() {
+function check_ncclient_version {
python << EOF
version = '$NCCLIENT_VERSION'
import sys
@@ -115,13 +115,13 @@
}
# Install the ncclient package
-function install_ncclient() {
+function install_ncclient {
git_clone $NCCLIENT_REPO $NCCLIENT_DIR $NCCLIENT_BRANCH
(cd $NCCLIENT_DIR; sudo python setup.py install)
}
# Check if the required version of ncclient has been installed
-function is_ncclient_installed() {
+function is_ncclient_installed {
# Check if the Cisco ncclient repository exists
if [[ -d $NCCLIENT_DIR ]]; then
remotes=$(cd $NCCLIENT_DIR; git remote -v | grep fetch | awk '{ print $2}')
@@ -144,7 +144,7 @@
return 0
}
-function has_neutron_plugin_security_group() {
+function has_neutron_plugin_security_group {
if _has_ovs_subplugin; then
ovs_has_neutron_plugin_security_group
else
@@ -152,14 +152,14 @@
fi
}
-function is_neutron_ovs_base_plugin() {
+function is_neutron_ovs_base_plugin {
# Cisco uses OVS if openvswitch subplugin is deployed
_has_ovs_subplugin
return
}
# populate required nova configuration parameters
-function neutron_plugin_create_nova_conf() {
+function neutron_plugin_create_nova_conf {
if _has_ovs_subplugin; then
ovs_neutron_plugin_create_nova_conf
else
@@ -167,13 +167,13 @@
fi
}
-function neutron_plugin_install_agent_packages() {
+function neutron_plugin_install_agent_packages {
# Cisco plugin uses openvswitch to operate in one of its configurations
ovs_neutron_plugin_install_agent_packages
}
# Configure common parameters
-function neutron_plugin_configure_common() {
+function neutron_plugin_configure_common {
# setup default subplugins
if [ ! -v Q_CISCO_PLUGIN_SUBPLUGINS ]; then
declare -ga Q_CISCO_PLUGIN_SUBPLUGINS
@@ -191,23 +191,23 @@
Q_DB_NAME=cisco_neutron
}
-function neutron_plugin_configure_debug_command() {
+function neutron_plugin_configure_debug_command {
if _has_ovs_subplugin; then
ovs_neutron_plugin_configure_debug_command
fi
}
-function neutron_plugin_configure_dhcp_agent() {
+function neutron_plugin_configure_dhcp_agent {
iniset $Q_DHCP_CONF_FILE DEFAULT dhcp_agent_manager neutron.agent.dhcp_agent.DhcpAgentWithStateReport
}
-function neutron_plugin_configure_l3_agent() {
+function neutron_plugin_configure_l3_agent {
if _has_ovs_subplugin; then
ovs_neutron_plugin_configure_l3_agent
fi
}
-function _configure_nexus_subplugin() {
+function _configure_nexus_subplugin {
local cisco_cfg_file=$1
# Install a known compatible ncclient from the Cisco repository if necessary
@@ -252,7 +252,7 @@
}
# Configure n1kv plugin
-function _configure_n1kv_subplugin() {
+function _configure_n1kv_subplugin {
local cisco_cfg_file=$1
# populate the cisco plugin cfg file with the VSM information
@@ -270,13 +270,13 @@
_neutron_ovs_base_setup_bridge $OVS_BRIDGE
}
-function neutron_plugin_configure_plugin_agent() {
+function neutron_plugin_configure_plugin_agent {
if _has_ovs_subplugin; then
ovs_neutron_plugin_configure_plugin_agent
fi
}
-function neutron_plugin_configure_service() {
+function neutron_plugin_configure_service {
local subplugin
local cisco_cfg_file
@@ -318,7 +318,7 @@
fi
}
-function neutron_plugin_setup_interface_driver() {
+function neutron_plugin_setup_interface_driver {
local conf_file=$1
iniset $conf_file DEFAULT interface_driver neutron.agent.linux.interface.OVSInterfaceDriver
}
diff --git a/lib/neutron_plugins/embrane b/lib/neutron_plugins/embrane
index 325e939..62f9737 100644
--- a/lib/neutron_plugins/embrane
+++ b/lib/neutron_plugins/embrane
@@ -7,7 +7,7 @@
source $TOP_DIR/lib/neutron_plugins/openvswitch
-save_function() {
+function save_function {
local ORIG_FUNC=$(declare -f $1)
local NEW_FUNC="$2${ORIG_FUNC#$1}"
eval "$NEW_FUNC"
@@ -15,14 +15,14 @@
save_function neutron_plugin_configure_service _neutron_plugin_configure_service
-function neutron_plugin_configure_common() {
+function neutron_plugin_configure_common {
Q_PLUGIN_CONF_PATH=etc/neutron/plugins/embrane
Q_PLUGIN_CONF_FILENAME=heleos_conf.ini
Q_DB_NAME="ovs_neutron"
Q_PLUGIN_CLASS="neutron.plugins.embrane.plugins.embrane_ovs_plugin.EmbraneOvsPlugin"
}
-function neutron_plugin_configure_service() {
+function neutron_plugin_configure_service {
_neutron_plugin_configure_service
iniset /$Q_PLUGIN_CONF_FILE heleos esm_mgmt $HELEOS_ESM_MGMT
iniset /$Q_PLUGIN_CONF_FILE heleos admin_username $HELEOS_ADMIN_USERNAME
diff --git a/lib/neutron_plugins/linuxbridge b/lib/neutron_plugins/linuxbridge
index 37bc748..362fd5b 100644
--- a/lib/neutron_plugins/linuxbridge
+++ b/lib/neutron_plugins/linuxbridge
@@ -7,14 +7,14 @@
source $TOP_DIR/lib/neutron_plugins/linuxbridge_agent
-function neutron_plugin_configure_common() {
+function neutron_plugin_configure_common {
Q_PLUGIN_CONF_PATH=etc/neutron/plugins/linuxbridge
Q_PLUGIN_CONF_FILENAME=linuxbridge_conf.ini
Q_DB_NAME="neutron_linux_bridge"
Q_PLUGIN_CLASS="neutron.plugins.linuxbridge.lb_neutron_plugin.LinuxBridgePluginV2"
}
-function neutron_plugin_configure_service() {
+function neutron_plugin_configure_service {
if [[ "$ENABLE_TENANT_VLANS" = "True" ]]; then
iniset /$Q_PLUGIN_CONF_FILE vlans tenant_network_type vlan
else
@@ -47,7 +47,7 @@
done
}
-function has_neutron_plugin_security_group() {
+function has_neutron_plugin_security_group {
# 0 means True here
return 0
}
diff --git a/lib/neutron_plugins/linuxbridge_agent b/lib/neutron_plugins/linuxbridge_agent
index 85e8c08..74799e4 100644
--- a/lib/neutron_plugins/linuxbridge_agent
+++ b/lib/neutron_plugins/linuxbridge_agent
@@ -5,33 +5,33 @@
PLUGIN_XTRACE=$(set +o | grep xtrace)
set +o xtrace
-function is_neutron_ovs_base_plugin() {
+function is_neutron_ovs_base_plugin {
# linuxbridge doesn't use OVS
return 1
}
-function neutron_plugin_create_nova_conf() {
+function neutron_plugin_create_nova_conf {
:
}
-function neutron_plugin_install_agent_packages() {
+function neutron_plugin_install_agent_packages {
install_package bridge-utils
}
-function neutron_plugin_configure_debug_command() {
+function neutron_plugin_configure_debug_command {
iniset $NEUTRON_TEST_CONFIG_FILE DEFAULT external_network_bridge
}
-function neutron_plugin_configure_dhcp_agent() {
+function neutron_plugin_configure_dhcp_agent {
iniset $Q_DHCP_CONF_FILE DEFAULT dhcp_agent_manager neutron.agent.dhcp_agent.DhcpAgentWithStateReport
}
-function neutron_plugin_configure_l3_agent() {
+function neutron_plugin_configure_l3_agent {
iniset $Q_L3_CONF_FILE DEFAULT external_network_bridge
iniset $Q_L3_CONF_FILE DEFAULT l3_agent_manager neutron.agent.l3_agent.L3NATAgentWithStateReport
}
-function neutron_plugin_configure_plugin_agent() {
+function neutron_plugin_configure_plugin_agent {
# Setup physical network interface mappings. Override
# ``LB_VLAN_RANGES`` and ``LB_INTERFACE_MAPPINGS`` in ``localrc`` for more
# complex physical network configurations.
@@ -63,12 +63,12 @@
done
}
-function neutron_plugin_setup_interface_driver() {
+function neutron_plugin_setup_interface_driver {
local conf_file=$1
iniset $conf_file DEFAULT interface_driver neutron.agent.linux.interface.BridgeInterfaceDriver
}
-function neutron_plugin_check_adv_test_requirements() {
+function neutron_plugin_check_adv_test_requirements {
is_service_enabled q-agt && is_service_enabled q-dhcp && return 0
}
diff --git a/lib/neutron_plugins/midonet b/lib/neutron_plugins/midonet
index dd3b2ba..742e3b2 100644
--- a/lib/neutron_plugins/midonet
+++ b/lib/neutron_plugins/midonet
@@ -9,32 +9,32 @@
MY_XTRACE=$(set +o | grep xtrace)
set +o xtrace
-function is_neutron_ovs_base_plugin() {
+function is_neutron_ovs_base_plugin {
# MidoNet does not use l3-agent
# 0 means True here
return 1
}
-function neutron_plugin_create_nova_conf() {
+function neutron_plugin_create_nova_conf {
NOVA_VIF_DRIVER=${NOVA_VIF_DRIVER:-"nova.virt.libvirt.vif.LibvirtGenericVIFDriver"}
}
-function neutron_plugin_install_agent_packages() {
+function neutron_plugin_install_agent_packages {
:
}
-function neutron_plugin_configure_common() {
+function neutron_plugin_configure_common {
Q_PLUGIN_CONF_PATH=etc/neutron/plugins/midonet
Q_PLUGIN_CONF_FILENAME=midonet.ini
Q_DB_NAME="neutron_midonet"
Q_PLUGIN_CLASS="neutron.plugins.midonet.plugin.MidonetPluginV2"
}
-function neutron_plugin_configure_debug_command() {
+function neutron_plugin_configure_debug_command {
:
}
-function neutron_plugin_configure_dhcp_agent() {
+function neutron_plugin_configure_dhcp_agent {
DHCP_DRIVER=${DHCP_DRIVER:-"neutron.plugins.midonet.agent.midonet_driver.DhcpNoOpDriver"}
neutron_plugin_setup_interface_driver $Q_DHCP_CONF_FILE
iniset $Q_DHCP_CONF_FILE DEFAULT dhcp_driver $DHCP_DRIVER
@@ -42,15 +42,15 @@
iniset $Q_DHCP_CONF_FILE DEFAULT enable_isolated_metadata True
}
-function neutron_plugin_configure_l3_agent() {
+function neutron_plugin_configure_l3_agent {
die $LINENO "q-l3 must not be executed with MidoNet plugin!"
}
-function neutron_plugin_configure_plugin_agent() {
+function neutron_plugin_configure_plugin_agent {
die $LINENO "q-agt must not be executed with MidoNet plugin!"
}
-function neutron_plugin_configure_service() {
+function neutron_plugin_configure_service {
if [[ "$MIDONET_API_URL" != "" ]]; then
iniset /$Q_PLUGIN_CONF_FILE MIDONET midonet_uri $MIDONET_API_URL
fi
@@ -68,17 +68,17 @@
Q_L3_ROUTER_PER_TENANT=True
}
-function neutron_plugin_setup_interface_driver() {
+function neutron_plugin_setup_interface_driver {
local conf_file=$1
iniset $conf_file DEFAULT interface_driver neutron.agent.linux.interface.MidonetInterfaceDriver
}
-function has_neutron_plugin_security_group() {
+function has_neutron_plugin_security_group {
# 0 means True here
return 0
}
-function neutron_plugin_check_adv_test_requirements() {
+function neutron_plugin_check_adv_test_requirements {
# 0 means True here
return 1
}
diff --git a/lib/neutron_plugins/ml2 b/lib/neutron_plugins/ml2
index 4ceabe7..e985dcb 100644
--- a/lib/neutron_plugins/ml2
+++ b/lib/neutron_plugins/ml2
@@ -33,7 +33,7 @@
# L3 Plugin to load for ML2
ML2_L3_PLUGIN=${ML2_L3_PLUGIN:-neutron.services.l3_router.l3_router_plugin.L3RouterPlugin}
-function populate_ml2_config() {
+function populate_ml2_config {
CONF=$1
SECTION=$2
OPTS=$3
@@ -47,7 +47,7 @@
done
}
-function neutron_plugin_configure_common() {
+function neutron_plugin_configure_common {
Q_PLUGIN_CONF_PATH=etc/neutron/plugins/ml2
Q_PLUGIN_CONF_FILENAME=ml2_conf.ini
Q_DB_NAME="neutron_ml2"
@@ -57,7 +57,7 @@
_neutron_service_plugin_class_add $ML2_L3_PLUGIN
}
-function neutron_plugin_configure_service() {
+function neutron_plugin_configure_service {
if [[ "$Q_ML2_TENANT_NETWORK_TYPE" != "" ]]; then
Q_SRV_EXTRA_OPTS+=(tenant_network_types=$Q_ML2_TENANT_NETWORK_TYPE)
elif [[ "$ENABLE_TENANT_TUNNELS" = "True" ]]; then
@@ -114,7 +114,7 @@
populate_ml2_config /$Q_PLUGIN_CONF_FILE ml2_type_vlan $Q_ML2_PLUGIN_VLAN_TYPE_OPTIONS
}
-function has_neutron_plugin_security_group() {
+function has_neutron_plugin_security_group {
return 0
}
diff --git a/lib/neutron_plugins/nec b/lib/neutron_plugins/nec
index 1cb2fef..6d4bfca 100644
--- a/lib/neutron_plugins/nec
+++ b/lib/neutron_plugins/nec
@@ -22,11 +22,11 @@
source $TOP_DIR/lib/neutron_plugins/ovs_base
-function neutron_plugin_create_nova_conf() {
+function neutron_plugin_create_nova_conf {
_neutron_ovs_base_configure_nova_vif_driver
}
-function neutron_plugin_install_agent_packages() {
+function neutron_plugin_install_agent_packages {
# SKIP_OVS_INSTALL is useful when we want to use Open vSwitch whose
# version is different from the version provided by the distribution.
if [[ "$SKIP_OVS_INSTALL" = "True" ]]; then
@@ -36,26 +36,26 @@
_neutron_ovs_base_install_agent_packages
}
-function neutron_plugin_configure_common() {
+function neutron_plugin_configure_common {
Q_PLUGIN_CONF_PATH=etc/neutron/plugins/nec
Q_PLUGIN_CONF_FILENAME=nec.ini
Q_DB_NAME="neutron_nec"
Q_PLUGIN_CLASS="neutron.plugins.nec.nec_plugin.NECPluginV2"
}
-function neutron_plugin_configure_debug_command() {
+function neutron_plugin_configure_debug_command {
_neutron_ovs_base_configure_debug_command
}
-function neutron_plugin_configure_dhcp_agent() {
+function neutron_plugin_configure_dhcp_agent {
:
}
-function neutron_plugin_configure_l3_agent() {
+function neutron_plugin_configure_l3_agent {
_neutron_ovs_base_configure_l3_agent
}
-function _quantum_plugin_setup_bridge() {
+function _quantum_plugin_setup_bridge {
if [[ "$SKIP_OVS_BRIDGE_SETUP" = "True" ]]; then
return
fi
@@ -72,7 +72,7 @@
_neutron_setup_ovs_tunnels $OVS_BRIDGE
}
-function neutron_plugin_configure_plugin_agent() {
+function neutron_plugin_configure_plugin_agent {
_quantum_plugin_setup_bridge
AGENT_BINARY="$NEUTRON_BIN_DIR/neutron-nec-agent"
@@ -80,7 +80,7 @@
_neutron_ovs_base_configure_firewall_driver
}
-function neutron_plugin_configure_service() {
+function neutron_plugin_configure_service {
iniset $NEUTRON_CONF DEFAULT api_extensions_path neutron/plugins/nec/extensions/
iniset /$Q_PLUGIN_CONF_FILE ofc host $OFC_API_HOST
iniset /$Q_PLUGIN_CONF_FILE ofc port $OFC_API_PORT
@@ -91,7 +91,7 @@
_neutron_ovs_base_configure_firewall_driver
}
-function neutron_plugin_setup_interface_driver() {
+function neutron_plugin_setup_interface_driver {
local conf_file=$1
iniset $conf_file DEFAULT interface_driver neutron.agent.linux.interface.OVSInterfaceDriver
iniset $conf_file DEFAULT ovs_use_veth True
@@ -101,7 +101,7 @@
# ---------------------------
# Setup OVS tunnel manually
-function _neutron_setup_ovs_tunnels() {
+function _neutron_setup_ovs_tunnels {
local bridge=$1
local id=0
GRE_LOCAL_IP=${GRE_LOCAL_IP:-$HOST_IP}
@@ -117,12 +117,12 @@
fi
}
-function has_neutron_plugin_security_group() {
+function has_neutron_plugin_security_group {
# 0 means True here
return 0
}
-function neutron_plugin_check_adv_test_requirements() {
+function neutron_plugin_check_adv_test_requirements {
is_service_enabled q-agt && is_service_enabled q-dhcp && return 0
}
diff --git a/lib/neutron_plugins/openvswitch b/lib/neutron_plugins/openvswitch
index f99eb38..bdbc5a9 100644
--- a/lib/neutron_plugins/openvswitch
+++ b/lib/neutron_plugins/openvswitch
@@ -7,14 +7,14 @@
source $TOP_DIR/lib/neutron_plugins/openvswitch_agent
-function neutron_plugin_configure_common() {
+function neutron_plugin_configure_common {
Q_PLUGIN_CONF_PATH=etc/neutron/plugins/openvswitch
Q_PLUGIN_CONF_FILENAME=ovs_neutron_plugin.ini
Q_DB_NAME="ovs_neutron"
Q_PLUGIN_CLASS="neutron.plugins.openvswitch.ovs_neutron_plugin.OVSNeutronPluginV2"
}
-function neutron_plugin_configure_service() {
+function neutron_plugin_configure_service {
if [[ "$ENABLE_TENANT_TUNNELS" = "True" ]]; then
iniset /$Q_PLUGIN_CONF_FILE ovs tenant_network_type gre
iniset /$Q_PLUGIN_CONF_FILE ovs tunnel_id_ranges $TENANT_TUNNEL_RANGES
@@ -52,7 +52,7 @@
done
}
-function has_neutron_plugin_security_group() {
+function has_neutron_plugin_security_group {
return 0
}
diff --git a/lib/neutron_plugins/openvswitch_agent b/lib/neutron_plugins/openvswitch_agent
index 46c2a5c..3a2bdc3 100644
--- a/lib/neutron_plugins/openvswitch_agent
+++ b/lib/neutron_plugins/openvswitch_agent
@@ -7,7 +7,7 @@
source $TOP_DIR/lib/neutron_plugins/ovs_base
-function neutron_plugin_create_nova_conf() {
+function neutron_plugin_create_nova_conf {
_neutron_ovs_base_configure_nova_vif_driver
if [ "$VIRT_DRIVER" = 'xenserver' ]; then
iniset $NOVA_CONF DEFAULT xenapi_vif_driver nova.virt.xenapi.vif.XenAPIOpenVswitchDriver
@@ -17,24 +17,24 @@
fi
}
-function neutron_plugin_install_agent_packages() {
+function neutron_plugin_install_agent_packages {
_neutron_ovs_base_install_agent_packages
}
-function neutron_plugin_configure_debug_command() {
+function neutron_plugin_configure_debug_command {
_neutron_ovs_base_configure_debug_command
}
-function neutron_plugin_configure_dhcp_agent() {
+function neutron_plugin_configure_dhcp_agent {
iniset $Q_DHCP_CONF_FILE DEFAULT dhcp_agent_manager neutron.agent.dhcp_agent.DhcpAgentWithStateReport
}
-function neutron_plugin_configure_l3_agent() {
+function neutron_plugin_configure_l3_agent {
_neutron_ovs_base_configure_l3_agent
iniset $Q_L3_CONF_FILE DEFAULT l3_agent_manager neutron.agent.l3_agent.L3NATAgentWithStateReport
}
-function neutron_plugin_configure_plugin_agent() {
+function neutron_plugin_configure_plugin_agent {
# Setup integration bridge
_neutron_ovs_base_setup_bridge $OVS_BRIDGE
_neutron_ovs_base_configure_firewall_driver
@@ -118,12 +118,12 @@
done
}
-function neutron_plugin_setup_interface_driver() {
+function neutron_plugin_setup_interface_driver {
local conf_file=$1
iniset $conf_file DEFAULT interface_driver neutron.agent.linux.interface.OVSInterfaceDriver
}
-function neutron_plugin_check_adv_test_requirements() {
+function neutron_plugin_check_adv_test_requirements {
is_service_enabled q-agt && is_service_enabled q-dhcp && return 0
}
diff --git a/lib/neutron_plugins/ovs_base b/lib/neutron_plugins/ovs_base
index 89db29d..0a2ba58 100644
--- a/lib/neutron_plugins/ovs_base
+++ b/lib/neutron_plugins/ovs_base
@@ -8,19 +8,19 @@
OVS_BRIDGE=${OVS_BRIDGE:-br-int}
PUBLIC_BRIDGE=${PUBLIC_BRIDGE:-br-ex}
-function is_neutron_ovs_base_plugin() {
+function is_neutron_ovs_base_plugin {
# Yes, we use OVS.
return 0
}
-function _neutron_ovs_base_setup_bridge() {
+function _neutron_ovs_base_setup_bridge {
local bridge=$1
neutron-ovs-cleanup
sudo ovs-vsctl --no-wait -- --may-exist add-br $bridge
sudo ovs-vsctl --no-wait br-set-external-id $bridge bridge-id $bridge
}
-function neutron_ovs_base_cleanup() {
+function neutron_ovs_base_cleanup {
# remove all OVS ports that look like Neutron created ports
for port in $(sudo ovs-vsctl list port | grep -o -e tap[0-9a-f\-]* -e q[rg]-[0-9a-f\-]*); do
sudo ovs-vsctl del-port ${port}
@@ -32,7 +32,7 @@
done
}
-function _neutron_ovs_base_install_agent_packages() {
+function _neutron_ovs_base_install_agent_packages {
local kernel_version
# Install deps
# FIXME add to ``files/apts/neutron``, but don't install if not needed!
@@ -50,11 +50,11 @@
fi
}
-function _neutron_ovs_base_configure_debug_command() {
+function _neutron_ovs_base_configure_debug_command {
iniset $NEUTRON_TEST_CONFIG_FILE DEFAULT external_network_bridge $PUBLIC_BRIDGE
}
-function _neutron_ovs_base_configure_firewall_driver() {
+function _neutron_ovs_base_configure_firewall_driver {
if [[ "$Q_USE_SECGROUP" == "True" ]]; then
iniset /$Q_PLUGIN_CONF_FILE securitygroup firewall_driver neutron.agent.linux.iptables_firewall.OVSHybridIptablesFirewallDriver
else
@@ -62,7 +62,7 @@
fi
}
-function _neutron_ovs_base_configure_l3_agent() {
+function _neutron_ovs_base_configure_l3_agent {
iniset $Q_L3_CONF_FILE DEFAULT external_network_bridge $PUBLIC_BRIDGE
neutron-ovs-cleanup
@@ -72,7 +72,7 @@
sudo ip addr flush dev $PUBLIC_BRIDGE
}
-function _neutron_ovs_base_configure_nova_vif_driver() {
+function _neutron_ovs_base_configure_nova_vif_driver {
:
}
diff --git a/lib/neutron_plugins/plumgrid b/lib/neutron_plugins/plumgrid
index bccd301..19f94cb 100644
--- a/lib/neutron_plugins/plumgrid
+++ b/lib/neutron_plugins/plumgrid
@@ -6,15 +6,15 @@
MY_XTRACE=$(set +o | grep xtrace)
set +o xtrace
-function neutron_plugin_create_nova_conf() {
+function neutron_plugin_create_nova_conf {
:
}
-function neutron_plugin_setup_interface_driver() {
+function neutron_plugin_setup_interface_driver {
:
}
-function neutron_plugin_configure_common() {
+function neutron_plugin_configure_common {
Q_PLUGIN_CONF_PATH=etc/neutron/plugins/plumgrid
Q_PLUGIN_CONF_FILENAME=plumgrid.ini
Q_DB_NAME="plumgrid_neutron"
@@ -26,7 +26,7 @@
PLUMGRID_TIMEOUT=${PLUMGRID_TIMEOUT:-70}
}
-function neutron_plugin_configure_service() {
+function neutron_plugin_configure_service {
iniset /$Q_PLUGIN_CONF_FILE PLUMgridDirector director_server $PLUMGRID_DIRECTOR_IP
iniset /$Q_PLUGIN_CONF_FILE PLUMgridDirector director_server_port $PLUMGRID_DIRECTOR_PORT
iniset /$Q_PLUGIN_CONF_FILE PLUMgridDirector username $PLUMGRID_ADMIN
@@ -34,21 +34,21 @@
iniset /$Q_PLUGIN_CONF_FILE PLUMgridDirector servertimeout $PLUMGRID_TIMEOUT
}
-function neutron_plugin_configure_debug_command() {
+function neutron_plugin_configure_debug_command {
:
}
-function is_neutron_ovs_base_plugin() {
+function is_neutron_ovs_base_plugin {
# False
return 1
}
-function has_neutron_plugin_security_group() {
+function has_neutron_plugin_security_group {
# False
return 1
}
-function neutron_plugin_check_adv_test_requirements() {
+function neutron_plugin_check_adv_test_requirements {
is_service_enabled q-agt && is_service_enabled q-dhcp && return 0
}
# Restore xtrace
diff --git a/lib/neutron_plugins/ryu b/lib/neutron_plugins/ryu
index 334c227..9ae36d3 100644
--- a/lib/neutron_plugins/ryu
+++ b/lib/neutron_plugins/ryu
@@ -8,12 +8,12 @@
source $TOP_DIR/lib/neutron_plugins/ovs_base
source $TOP_DIR/lib/neutron_thirdparty/ryu # for configuration value
-function neutron_plugin_create_nova_conf() {
+function neutron_plugin_create_nova_conf {
_neutron_ovs_base_configure_nova_vif_driver
iniset $NOVA_CONF DEFAULT libvirt_ovs_integration_bridge "$OVS_BRIDGE"
}
-function neutron_plugin_install_agent_packages() {
+function neutron_plugin_install_agent_packages {
_neutron_ovs_base_install_agent_packages
# neutron_ryu_agent requires ryu module
@@ -22,28 +22,28 @@
configure_ryu
}
-function neutron_plugin_configure_common() {
+function neutron_plugin_configure_common {
Q_PLUGIN_CONF_PATH=etc/neutron/plugins/ryu
Q_PLUGIN_CONF_FILENAME=ryu.ini
Q_DB_NAME="ovs_neutron"
Q_PLUGIN_CLASS="neutron.plugins.ryu.ryu_neutron_plugin.RyuNeutronPluginV2"
}
-function neutron_plugin_configure_debug_command() {
+function neutron_plugin_configure_debug_command {
_neutron_ovs_base_configure_debug_command
iniset $NEUTRON_TEST_CONFIG_FILE DEFAULT ryu_api_host $RYU_API_HOST:$RYU_API_PORT
}
-function neutron_plugin_configure_dhcp_agent() {
+function neutron_plugin_configure_dhcp_agent {
iniset $Q_DHCP_CONF_FILE DEFAULT ryu_api_host $RYU_API_HOST:$RYU_API_PORT
}
-function neutron_plugin_configure_l3_agent() {
+function neutron_plugin_configure_l3_agent {
iniset $Q_L3_CONF_FILE DEFAULT ryu_api_host $RYU_API_HOST:$RYU_API_PORT
_neutron_ovs_base_configure_l3_agent
}
-function neutron_plugin_configure_plugin_agent() {
+function neutron_plugin_configure_plugin_agent {
# Set up integration bridge
_neutron_ovs_base_setup_bridge $OVS_BRIDGE
if [ -n "$RYU_INTERNAL_INTERFACE" ]; then
@@ -55,24 +55,24 @@
_neutron_ovs_base_configure_firewall_driver
}
-function neutron_plugin_configure_service() {
+function neutron_plugin_configure_service {
iniset /$Q_PLUGIN_CONF_FILE ovs openflow_rest_api $RYU_API_HOST:$RYU_API_PORT
_neutron_ovs_base_configure_firewall_driver
}
-function neutron_plugin_setup_interface_driver() {
+function neutron_plugin_setup_interface_driver {
local conf_file=$1
iniset $conf_file DEFAULT interface_driver neutron.agent.linux.interface.OVSInterfaceDriver
iniset $conf_file DEFAULT ovs_use_veth True
}
-function has_neutron_plugin_security_group() {
+function has_neutron_plugin_security_group {
# 0 means True here
return 0
}
-function neutron_plugin_check_adv_test_requirements() {
+function neutron_plugin_check_adv_test_requirements {
is_service_enabled q-agt && is_service_enabled q-dhcp && return 0
}
diff --git a/lib/neutron_plugins/services/firewall b/lib/neutron_plugins/services/firewall
index 8273e54..ab6c324 100644
--- a/lib/neutron_plugins/services/firewall
+++ b/lib/neutron_plugins/services/firewall
@@ -7,11 +7,11 @@
FWAAS_PLUGIN=neutron.services.firewall.fwaas_plugin.FirewallPlugin
-function neutron_fwaas_configure_common() {
+function neutron_fwaas_configure_common {
_neutron_service_plugin_class_add $FWAAS_PLUGIN
}
-function neutron_fwaas_configure_driver() {
+function neutron_fwaas_configure_driver {
FWAAS_DRIVER_CONF_FILENAME=/etc/neutron/fwaas_driver.ini
cp $NEUTRON_DIR/etc/fwaas_driver.ini $FWAAS_DRIVER_CONF_FILENAME
@@ -19,7 +19,7 @@
iniset_multiline $FWAAS_DRIVER_CONF_FILENAME fwaas driver "neutron.services.firewall.drivers.linux.iptables_fwaas.IptablesFwaasDriver"
}
-function neutron_fwaas_stop() {
+function neutron_fwaas_stop {
:
}
diff --git a/lib/neutron_plugins/services/loadbalancer b/lib/neutron_plugins/services/loadbalancer
index 5d7a94e..744826e 100644
--- a/lib/neutron_plugins/services/loadbalancer
+++ b/lib/neutron_plugins/services/loadbalancer
@@ -9,7 +9,7 @@
AGENT_LBAAS_BINARY="$NEUTRON_BIN_DIR/neutron-lbaas-agent"
LBAAS_PLUGIN=neutron.services.loadbalancer.plugin.LoadBalancerPlugin
-function neutron_agent_lbaas_install_agent_packages() {
+function neutron_agent_lbaas_install_agent_packages {
if is_ubuntu || is_fedora; then
install_package haproxy
elif is_suse; then
@@ -18,11 +18,11 @@
fi
}
-function neutron_agent_lbaas_configure_common() {
+function neutron_agent_lbaas_configure_common {
_neutron_service_plugin_class_add $LBAAS_PLUGIN
}
-function neutron_agent_lbaas_configure_agent() {
+function neutron_agent_lbaas_configure_agent {
LBAAS_AGENT_CONF_PATH=/etc/neutron/services/loadbalancer/haproxy
mkdir -p $LBAAS_AGENT_CONF_PATH
@@ -41,7 +41,7 @@
fi
}
-function neutron_lbaas_stop() {
+function neutron_lbaas_stop {
pids=$(ps aux | awk '/haproxy/ { print $2 }')
[ ! -z "$pids" ] && sudo kill $pids
}
diff --git a/lib/neutron_plugins/services/metering b/lib/neutron_plugins/services/metering
index 37952bb..0e5f75b 100644
--- a/lib/neutron_plugins/services/metering
+++ b/lib/neutron_plugins/services/metering
@@ -9,11 +9,11 @@
AGENT_METERING_BINARY="$NEUTRON_BIN_DIR/neutron-metering-agent"
METERING_PLUGIN="neutron.services.metering.metering_plugin.MeteringPlugin"
-function neutron_agent_metering_configure_common() {
+function neutron_agent_metering_configure_common {
_neutron_service_plugin_class_add $METERING_PLUGIN
}
-function neutron_agent_metering_configure_agent() {
+function neutron_agent_metering_configure_agent {
METERING_AGENT_CONF_PATH=/etc/neutron/services/metering
mkdir -p $METERING_AGENT_CONF_PATH
@@ -22,7 +22,7 @@
cp $NEUTRON_DIR/etc/metering_agent.ini $METERING_AGENT_CONF_FILENAME
}
-function neutron_metering_stop() {
+function neutron_metering_stop {
:
}
diff --git a/lib/neutron_plugins/services/vpn b/lib/neutron_plugins/services/vpn
index 02370e7..e56d361 100644
--- a/lib/neutron_plugins/services/vpn
+++ b/lib/neutron_plugins/services/vpn
@@ -10,15 +10,15 @@
VPN_PLUGIN="neutron.services.vpn.plugin.VPNDriverPlugin"
IPSEC_PACKAGE=${IPSEC_PACKAGE:-"openswan"}
-function neutron_vpn_install_agent_packages() {
+function neutron_vpn_install_agent_packages {
install_package $IPSEC_PACKAGE
}
-function neutron_vpn_configure_common() {
+function neutron_vpn_configure_common {
_neutron_service_plugin_class_add $VPN_PLUGIN
}
-function neutron_vpn_stop() {
+function neutron_vpn_stop {
local ipsec_data_dir=$DATA_DIR/neutron/ipsec
local pids
if [ -d $ipsec_data_dir ]; then
diff --git a/lib/neutron_plugins/vmware_nsx b/lib/neutron_plugins/vmware_nsx
index d506cb6..0930422 100644
--- a/lib/neutron_plugins/vmware_nsx
+++ b/lib/neutron_plugins/vmware_nsx
@@ -7,7 +7,7 @@
source $TOP_DIR/lib/neutron_plugins/ovs_base
-function setup_integration_bridge() {
+function setup_integration_bridge {
_neutron_ovs_base_setup_bridge $OVS_BRIDGE
# Set manager to NSX controller (1st of list)
if [[ "$NSX_CONTROLLERS" != "" ]]; then
@@ -20,24 +20,24 @@
sudo ovs-vsctl set-manager ssl:$OVS_MGR_IP
}
-function is_neutron_ovs_base_plugin() {
+function is_neutron_ovs_base_plugin {
# NSX uses OVS, but not the l3-agent
return 0
}
-function neutron_plugin_create_nova_conf() {
+function neutron_plugin_create_nova_conf {
# if n-cpu is enabled, then setup integration bridge
if is_service_enabled n-cpu; then
setup_integration_bridge
fi
}
-function neutron_plugin_install_agent_packages() {
+function neutron_plugin_install_agent_packages {
# VMware NSX Plugin does not run q-agt, but it currently needs dhcp and metadata agents
_neutron_ovs_base_install_agent_packages
}
-function neutron_plugin_configure_common() {
+function neutron_plugin_configure_common {
Q_PLUGIN_CONF_PATH=etc/neutron/plugins/vmware
Q_PLUGIN_CONF_FILENAME=nsx.ini
Q_DB_NAME="neutron_nsx"
@@ -45,29 +45,29 @@
Q_PLUGIN_CLASS="neutron.plugins.nicira.NeutronPlugin.NvpPluginV2"
}
-function neutron_plugin_configure_debug_command() {
+function neutron_plugin_configure_debug_command {
sudo ovs-vsctl --no-wait -- --may-exist add-br $PUBLIC_BRIDGE
iniset $NEUTRON_TEST_CONFIG_FILE DEFAULT external_network_bridge "$PUBLIC_BRIDGE"
}
-function neutron_plugin_configure_dhcp_agent() {
+function neutron_plugin_configure_dhcp_agent {
setup_integration_bridge
iniset $Q_DHCP_CONF_FILE DEFAULT enable_isolated_metadata True
iniset $Q_DHCP_CONF_FILE DEFAULT enable_metadata_network True
iniset $Q_DHCP_CONF_FILE DEFAULT ovs_use_veth True
}
-function neutron_plugin_configure_l3_agent() {
+function neutron_plugin_configure_l3_agent {
# VMware NSX plugin does not run L3 agent
die $LINENO "q-l3 should must not be executed with VMware NSX plugin!"
}
-function neutron_plugin_configure_plugin_agent() {
+function neutron_plugin_configure_plugin_agent {
# VMware NSX plugin does not run L2 agent
die $LINENO "q-agt must not be executed with VMware NSX plugin!"
}
-function neutron_plugin_configure_service() {
+function neutron_plugin_configure_service {
if [[ "$MAX_LP_PER_BRIDGED_LS" != "" ]]; then
iniset /$Q_PLUGIN_CONF_FILE nsx max_lp_per_bridged_ls $MAX_LP_PER_BRIDGED_LS
fi
@@ -132,17 +132,17 @@
fi
}
-function neutron_plugin_setup_interface_driver() {
+function neutron_plugin_setup_interface_driver {
local conf_file=$1
iniset $conf_file DEFAULT interface_driver neutron.agent.linux.interface.OVSInterfaceDriver
}
-function has_neutron_plugin_security_group() {
+function has_neutron_plugin_security_group {
# 0 means True here
return 0
}
-function neutron_plugin_check_adv_test_requirements() {
+function neutron_plugin_check_adv_test_requirements {
is_service_enabled q-dhcp && return 0
}