| Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 1 | # Neuton Big Switch/FloodLight plugin | 
|  | 2 | # ------------------------------------ | 
|  | 3 |  | 
|  | 4 | # Save trace setting | 
| Dean Troyer | e3a9160 | 2014-03-28 12:40:56 -0500 | [diff] [blame] | 5 | BS_XTRACE=$(set +o | grep xtrace) | 
| Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 6 | set +o xtrace | 
|  | 7 |  | 
|  | 8 | source $TOP_DIR/lib/neutron_plugins/ovs_base | 
|  | 9 | source $TOP_DIR/lib/neutron_thirdparty/bigswitch_floodlight     # for third party service specific configuration values | 
|  | 10 |  | 
| Ian Wienand | aee18c7 | 2014-02-21 15:35:08 +1100 | [diff] [blame] | 11 | function neutron_plugin_create_nova_conf { | 
| Aaron Rosen | 4540d00 | 2013-10-24 13:59:33 -0700 | [diff] [blame] | 12 | : | 
| Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 13 | } | 
|  | 14 |  | 
| Ian Wienand | aee18c7 | 2014-02-21 15:35:08 +1100 | [diff] [blame] | 15 | function neutron_plugin_install_agent_packages { | 
| Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 16 | _neutron_ovs_base_install_agent_packages | 
|  | 17 | } | 
|  | 18 |  | 
| Ian Wienand | aee18c7 | 2014-02-21 15:35:08 +1100 | [diff] [blame] | 19 | function neutron_plugin_configure_common { | 
| Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 20 | Q_PLUGIN_CONF_PATH=etc/neutron/plugins/bigswitch | 
|  | 21 | Q_PLUGIN_CONF_FILENAME=restproxy.ini | 
|  | 22 | Q_DB_NAME="restproxy_neutron" | 
|  | 23 | Q_PLUGIN_CLASS="neutron.plugins.bigswitch.plugin.NeutronRestProxyV2" | 
|  | 24 | BS_FL_CONTROLLERS_PORT=${BS_FL_CONTROLLERS_PORT:-localhost:80} | 
|  | 25 | BS_FL_CONTROLLER_TIMEOUT=${BS_FL_CONTROLLER_TIMEOUT:-10} | 
|  | 26 | } | 
|  | 27 |  | 
| Ian Wienand | aee18c7 | 2014-02-21 15:35:08 +1100 | [diff] [blame] | 28 | function neutron_plugin_configure_debug_command { | 
| Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 29 | _neutron_ovs_base_configure_debug_command | 
|  | 30 | } | 
|  | 31 |  | 
| Ian Wienand | aee18c7 | 2014-02-21 15:35:08 +1100 | [diff] [blame] | 32 | function neutron_plugin_configure_dhcp_agent { | 
| Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 33 | : | 
|  | 34 | } | 
|  | 35 |  | 
| Ian Wienand | aee18c7 | 2014-02-21 15:35:08 +1100 | [diff] [blame] | 36 | function neutron_plugin_configure_l3_agent { | 
| Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 37 | _neutron_ovs_base_configure_l3_agent | 
|  | 38 | } | 
|  | 39 |  | 
| Ian Wienand | aee18c7 | 2014-02-21 15:35:08 +1100 | [diff] [blame] | 40 | function neutron_plugin_configure_plugin_agent { | 
| Kevin Benton | 753afeb | 2014-02-13 17:17:30 -0800 | [diff] [blame] | 41 | # Set up integration bridge | 
|  | 42 | _neutron_ovs_base_setup_bridge $OVS_BRIDGE | 
|  | 43 | iniset /$Q_PLUGIN_CONF_FILE restproxyagent integration_bridge $OVS_BRIDGE | 
|  | 44 | AGENT_BINARY="$NEUTRON_DIR/neutron/plugins/bigswitch/agent/restproxy_agent.py" | 
|  | 45 |  | 
|  | 46 | _neutron_ovs_base_configure_firewall_driver | 
| Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 47 | } | 
|  | 48 |  | 
| Ian Wienand | aee18c7 | 2014-02-21 15:35:08 +1100 | [diff] [blame] | 49 | function neutron_plugin_configure_service { | 
| Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 50 | iniset /$Q_PLUGIN_CONF_FILE restproxy servers $BS_FL_CONTROLLERS_PORT | 
|  | 51 | iniset /$Q_PLUGIN_CONF_FILE restproxy servertimeout $BS_FL_CONTROLLER_TIMEOUT | 
| Sean Dague | 16dd8b3 | 2014-02-03 09:10:54 +0900 | [diff] [blame] | 52 | if [ "$BS_FL_VIF_DRIVER" = "ivs" ]; then | 
| Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 53 | iniset /$Q_PLUGIN_CONF_FILE nova vif_type ivs | 
|  | 54 | fi | 
|  | 55 | } | 
|  | 56 |  | 
| Ian Wienand | aee18c7 | 2014-02-21 15:35:08 +1100 | [diff] [blame] | 57 | function neutron_plugin_setup_interface_driver { | 
| Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 58 | local conf_file=$1 | 
| Sean Dague | 16dd8b3 | 2014-02-03 09:10:54 +0900 | [diff] [blame] | 59 | if [ "$BS_FL_VIF_DRIVER" = "ivs" ]; then | 
| Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 60 | iniset $conf_file DEFAULT interface_driver neutron.agent.linux.interface.IVSInterfaceDriver | 
|  | 61 | else | 
|  | 62 | iniset $conf_file DEFAULT interface_driver neutron.agent.linux.interface.OVSInterfaceDriver | 
|  | 63 | fi | 
|  | 64 | } | 
|  | 65 |  | 
|  | 66 |  | 
| Ian Wienand | aee18c7 | 2014-02-21 15:35:08 +1100 | [diff] [blame] | 67 | function has_neutron_plugin_security_group { | 
| Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 68 | # 1 means False here | 
| Kevin Benton | 753afeb | 2014-02-13 17:17:30 -0800 | [diff] [blame] | 69 | return 0 | 
| Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 70 | } | 
|  | 71 |  | 
| Ian Wienand | aee18c7 | 2014-02-21 15:35:08 +1100 | [diff] [blame] | 72 | function neutron_plugin_check_adv_test_requirements { | 
| Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 73 | is_service_enabled q-agt && is_service_enabled q-dhcp && return 0 | 
|  | 74 | } | 
|  | 75 |  | 
|  | 76 | # Restore xtrace | 
| Dean Troyer | e3a9160 | 2014-03-28 12:40:56 -0500 | [diff] [blame] | 77 | $BS_XTRACE |