X-Git-Url: https://review.fuel-infra.org/gitweb?a=blobdiff_plain;f=trusty%2Fdebian%2Fplugin_guess_func;fp=trusty%2Fdebian%2Fplugin_guess_func;h=1dfa5244deadd6584020b4561b2914910e6ead91;hb=33f494780fed13daabda23be6ceef83210e1d403;hp=0000000000000000000000000000000000000000;hpb=54c2ba6a6661f3214775d91c5755c37c685574a4;p=openstack-build%2Fneutron-build.git diff --git a/trusty/debian/plugin_guess_func b/trusty/debian/plugin_guess_func new file mode 100644 index 000000000..1dfa5244d --- /dev/null +++ b/trusty/debian/plugin_guess_func @@ -0,0 +1,158 @@ +#!/bin/sh + +# Remember to also add any new plugin name into neutron-common.templates + +# Please remember this function is also duplicated in debian/neutron-common.config.in +### Guess the plugin name depending on the class of the plugin in /etc/neutron/neutron.conf ### +neutron_core_plugin_to_plugin_name () { + case ${1} in + "neutron.plugins.openvswitch.ovs_neutron_plugin.OVSNeutronPluginV2") + NEUTRON_PLUGIN_NAME=OpenVSwitch + ;; + "neutron.plugins.linuxbridge.lb_neutron_plugin.LinuxBridgePluginV2") + NEUTRON_PLUGIN_NAME=LinuxBridge + ;; + "neutron.plugins.ml2.plugin.Ml2Plugin") + NEUTRON_PLUGIN_NAME=ml2 + ;; + "neutron.plugins.ryu.ryu_neutron_plugin.RyuNeutronPluginV2") + NEUTRON_PLUGIN_NAME=RYU + ;; + "neutron.plugins.plumgrid.plumgrid_nos_plugin.plumgrid_plugin.NeutronPluginPLUMgridV2") + NEUTRON_PLUGIN_NAME=PLUMgrid + ;; + "neutron.plugins.brocade.NeutronPlugin.BrocadePluginV2") + NEUTRON_PLUGIN_NAME=Brocade + ;; + "neutron.plugins.hyperv.hyperv_neutron_plugin.HyperVNeutronPlugin") + NEUTRON_PLUGIN_NAME=Hyper-V + ;; + "neutron.plugins.bigswitch.plugin.NeutronRestProxyV2") + NEUTRON_PLUGIN_NAME=BigSwitch + ;; + "neutron.plugins.cisco.network_plugin.PluginV2") + NEUTRON_PLUGIN_NAME=Cisco + ;; + "neutron.plugins.nicira.NeutronPlugin.NvpPluginV2") + NEUTRON_PLUGIN_NAME=neutron.plugins.nicira.NeutronPlugin.NvpPluginV2 + ;; + "neutron.plugins.midonet.plugin.MidonetPluginV2") + NEUTRON_PLUGIN_NAME=Midonet + ;; + "neutron.plugins.nec.nec_plugin.NECPluginV2") + NEUTRON_PLUGIN_NAME=Nec + ;; + "neutron.plugins.metaplugin.meta_neutron_plugin.MetaPluginV2") + NEUTRON_PLUGIN_NAME=MetaPlugin + ;; + "neutron.plugins.mlnx.mlnx_plugin.MellanoxEswitchPlugin") + NEUTRON_PLUGIN_NAME=Mellanox + ;; + *) + NEUTRON_PLUGIN_NAME="other" + ;; + esac +} + +### Guess the path of the plugin .ini file depending on the plugin name ### +neutron_plugin_ini_path () { + PLUG_INI_BASE=/etc/neutron/plugins/ + case ${1} in + "OpenVSwitch") + NEUTRON_PLUGIN_CONFIG=${PLUG_INI_BASE}ml2/openvswitch_agent.ini + ;; + "LinuxBridge") + NEUTRON_PLUGIN_CONFIG=${PLUG_INI_BASE}linuxbridge/linuxbridge_conf.ini + ;; + "ml2") + NEUTRON_PLUGIN_CONFIG=${PLUG_INI_BASE}ml2/ml2_conf.ini + ;; + "RYU") + NEUTRON_PLUGIN_CONFIG=${PLUG_INI_BASE}ryu/ryu.ini + ;; + "PLUMgrid") + NEUTRON_PLUGIN_CONFIG=${PLUG_INI_BASE}plumgrid/plumgrid.ini + ;; + "Brocade") + NEUTRON_PLUGIN_CONFIG=${PLUG_INI_BASE}brocade/brocade.ini + ;; + "Hyper-V") + NEUTRON_PLUGIN_CONFIG=${PLUG_INI_BASE}hyperv/hyperv_neutron_plugin.ini + ;; + "BigSwitch") + NEUTRON_PLUGIN_CONFIG=${PLUG_INI_BASE}bigswitch/restproxy.ini + ;; + "Cisco") + NEUTRON_PLUGIN_CONFIG=${PLUG_INI_BASE}cisco/cisco_plugins.ini + ;; + "Nicira") + NEUTRON_PLUGIN_CONFIG=${PLUG_INI_BASE}nicira/nvp.ini + ;; + "Midonet") + NEUTRON_PLUGIN_CONFIG=${PLUG_INI_BASE}midonet/midonet.ini + ;; + "Nec") + NEUTRON_PLUGIN_CONFIG=${PLUG_INI_BASE}nec/nec.ini + ;; + "MetaPlugin") + NEUTRON_PLUGIN_CONFIG=${PLUG_INI_BASE}metaplugin/metaplugin.ini + ;; + "Mellanox") + NEUTRON_PLUGIN_CONFIG=${PLUG_INI_BASE}mlnx/mlnx_conf.ini + ;; + *) + NEUTRON_PLUGIN_CONFIG="" + ;; + esac +} + +### Translates the core_plugin directive value from neutron.conf into the plugin name ### +neutron_core_plugin_to_plugin_name () { + case ${1} in + "neutron.plugins.openvswitch.ovs_neutron_plugin.OVSNeutronPluginV2") + NEUTRON_PLUGIN_NAME=OpenVSwitch + ;; + "neutron.plugins.linuxbridge.lb_neutron_plugin.LinuxBridgePluginV2") + NEUTRON_PLUGIN_NAME=LinuxBridge + ;; + "neutron.plugins.ml2.plugin.Ml2Plugin") + NEUTRON_PLUGIN_NAME=ml2 + ;; + "neutron.plugins.ryu.ryu_neutron_plugin.RyuNeutronPluginV2") + NEUTRON_PLUGIN_NAME=RYU + ;; + "neutron.plugins.plumgrid.plumgrid_nos_plugin.plumgrid_plugin.NeutronPluginPLUMgridV2") + NEUTRON_PLUGIN_NAME=PLUMgrid + ;; + "neutron.plugins.brocade.NeutronPlugin.BrocadePluginV2") + NEUTRON_PLUGIN_NAME=Brocade + ;; + "neutron.plugins.hyperv.hyperv_neutron_plugin.HyperVNeutronPlugin") + NEUTRON_PLUGIN_NAME=Hyper-V + ;; + "neutron.plugins.bigswitch.plugin.NeutronRestProxyV2") + NEUTRON_PLUGIN_NAME=BigSwitch + ;; + "neutron.plugins.cisco.network_plugin.PluginV2") + NEUTRON_PLUGIN_NAME=Cisco + ;; + "neutron.plugins.nicira.NeutronPlugin.NvpPluginV2") + NEUTRON_PLUGIN_NAME=neutron.plugins.nicira.NeutronPlugin.NvpPluginV2 + ;; + "neutron.plugins.midonet.plugin.MidonetPluginV2") + NEUTRON_PLUGIN_NAME=Midonet + ;; + "neutron.plugins.nec.nec_plugin.NECPluginV2") + NEUTRON_PLUGIN_NAME=Nec + ;; + "neutron.plugins.metaplugin.meta_neutron_plugin.MetaPluginV2") + NEUTRON_PLUGIN_NAME=MetaPlugin + ;; + "neutron.plugins.mlnx.mlnx_plugin.MellanoxEswitchPlugin") + NEUTRON_PLUGIN_NAME=Mellanox + ;; + *) + NEUTRON_PLUGIN_NAME="other" + ;; + esac +}