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/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
}