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