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 | # PLUMgrid Neutron Plugin |
| 4 | # Edgar Magana emagana@plumgrid.com |
| 5 | # ------------------------------------ |
| 6 | |
| 7 | # Save trace settings |
Dean Troyer | e3a9160 | 2014-03-28 12:40:56 -0500 | [diff] [blame] | 8 | PG_XTRACE=$(set +o | grep xtrace) |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 9 | set +o xtrace |
| 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_setup_interface_driver { |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 16 | : |
| 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/plumgrid |
| 21 | Q_PLUGIN_CONF_FILENAME=plumgrid.ini |
Edgar Magana | f34424e | 2013-07-29 16:47:13 -0700 | [diff] [blame] | 22 | Q_PLUGIN_CLASS="neutron.plugins.plumgrid.plumgrid_plugin.plumgrid_plugin.NeutronPluginPLUMgridV2" |
Edgar Magana | aeb85c1 | 2013-07-05 11:03:57 -0700 | [diff] [blame] | 23 | PLUMGRID_DIRECTOR_IP=${PLUMGRID_DIRECTOR_IP:-localhost} |
| 24 | PLUMGRID_DIRECTOR_PORT=${PLUMGRID_DIRECTOR_PORT:-7766} |
Edgar Magana | 500a32f | 2013-12-02 14:27:31 -0800 | [diff] [blame] | 25 | PLUMGRID_ADMIN=${PLUMGRID_ADMIN:-username} |
| 26 | PLUMGRID_PASSWORD=${PLUMGRID_PASSWORD:-password} |
| 27 | PLUMGRID_TIMEOUT=${PLUMGRID_TIMEOUT:-70} |
Edgar Magana | 41a4f27 | 2014-05-01 16:34:34 -0700 | [diff] [blame] | 28 | PLUMGRID_DRIVER=${PLUMGRID_DRIVER:-neutron.plugins.plumgrid.drivers.fake_plumlib.Plumlib} |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 29 | } |
| 30 | |
Ian Wienand | aee18c7 | 2014-02-21 15:35:08 +1100 | [diff] [blame] | 31 | function neutron_plugin_configure_service { |
Edgar Magana | 41a4f27 | 2014-05-01 16:34:34 -0700 | [diff] [blame] | 32 | iniset /$Q_PLUGIN_CONF_FILE plumgriddirector director_server $PLUMGRID_DIRECTOR_IP |
| 33 | iniset /$Q_PLUGIN_CONF_FILE plumgriddirector director_server_port $PLUMGRID_DIRECTOR_PORT |
| 34 | iniset /$Q_PLUGIN_CONF_FILE plumgriddirector username $PLUMGRID_ADMIN |
| 35 | iniset /$Q_PLUGIN_CONF_FILE plumgriddirector password $PLUMGRID_PASSWORD |
| 36 | iniset /$Q_PLUGIN_CONF_FILE plumgriddirector servertimeout $PLUMGRID_TIMEOUT |
| 37 | iniset /$Q_PLUGIN_CONF_FILE plumgriddirector driver $PLUMGRID_DRIVER |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 38 | } |
| 39 | |
Ian Wienand | aee18c7 | 2014-02-21 15:35:08 +1100 | [diff] [blame] | 40 | function neutron_plugin_configure_debug_command { |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 41 | : |
| 42 | } |
| 43 | |
Ian Wienand | aee18c7 | 2014-02-21 15:35:08 +1100 | [diff] [blame] | 44 | function is_neutron_ovs_base_plugin { |
Edgar Magana | f34424e | 2013-07-29 16:47:13 -0700 | [diff] [blame] | 45 | # False |
| 46 | return 1 |
| 47 | } |
| 48 | |
Ian Wienand | aee18c7 | 2014-02-21 15:35:08 +1100 | [diff] [blame] | 49 | function has_neutron_plugin_security_group { |
Fawad Khaliq | 242c098 | 2014-07-15 17:51:44 -0700 | [diff] [blame] | 50 | # return 0 means enabled |
| 51 | return 0 |
Edgar Magana | f34424e | 2013-07-29 16:47:13 -0700 | [diff] [blame] | 52 | } |
| 53 | |
Ian Wienand | aee18c7 | 2014-02-21 15:35:08 +1100 | [diff] [blame] | 54 | function neutron_plugin_check_adv_test_requirements { |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 55 | is_service_enabled q-agt && is_service_enabled q-dhcp && return 0 |
| 56 | } |
| 57 | # Restore xtrace |
Dean Troyer | e3a9160 | 2014-03-28 12:40:56 -0500 | [diff] [blame] | 58 | $PG_XTRACE |