Add Neutron 7.0.0 for Ubuntu 14.04
[openstack-build/neutron-build.git] / trusty / debian / plugin_guess_func
1 #!/bin/sh
2
3 # Remember to also add any new plugin name into neutron-common.templates
4
5 # Please remember this function is also duplicated in debian/neutron-common.config.in
6 ### Guess the plugin name depending on the class of the plugin in /etc/neutron/neutron.conf ###
7 neutron_core_plugin_to_plugin_name () {
8         case ${1} in
9         "neutron.plugins.openvswitch.ovs_neutron_plugin.OVSNeutronPluginV2")
10                 NEUTRON_PLUGIN_NAME=OpenVSwitch
11         ;;
12         "neutron.plugins.linuxbridge.lb_neutron_plugin.LinuxBridgePluginV2")
13                 NEUTRON_PLUGIN_NAME=LinuxBridge
14         ;;
15         "neutron.plugins.ml2.plugin.Ml2Plugin")
16                 NEUTRON_PLUGIN_NAME=ml2
17         ;;
18         "neutron.plugins.ryu.ryu_neutron_plugin.RyuNeutronPluginV2")
19                 NEUTRON_PLUGIN_NAME=RYU
20         ;;
21         "neutron.plugins.plumgrid.plumgrid_nos_plugin.plumgrid_plugin.NeutronPluginPLUMgridV2")
22                 NEUTRON_PLUGIN_NAME=PLUMgrid
23         ;;
24         "neutron.plugins.brocade.NeutronPlugin.BrocadePluginV2")
25                 NEUTRON_PLUGIN_NAME=Brocade
26         ;;
27         "neutron.plugins.hyperv.hyperv_neutron_plugin.HyperVNeutronPlugin")
28                 NEUTRON_PLUGIN_NAME=Hyper-V
29         ;;
30         "neutron.plugins.bigswitch.plugin.NeutronRestProxyV2")
31                 NEUTRON_PLUGIN_NAME=BigSwitch
32         ;;
33         "neutron.plugins.cisco.network_plugin.PluginV2")
34                 NEUTRON_PLUGIN_NAME=Cisco
35         ;;
36         "neutron.plugins.nicira.NeutronPlugin.NvpPluginV2")
37                 NEUTRON_PLUGIN_NAME=neutron.plugins.nicira.NeutronPlugin.NvpPluginV2
38         ;;
39         "neutron.plugins.midonet.plugin.MidonetPluginV2")
40                 NEUTRON_PLUGIN_NAME=Midonet
41         ;;
42         "neutron.plugins.nec.nec_plugin.NECPluginV2")
43                 NEUTRON_PLUGIN_NAME=Nec
44         ;;
45         "neutron.plugins.metaplugin.meta_neutron_plugin.MetaPluginV2")
46                 NEUTRON_PLUGIN_NAME=MetaPlugin
47         ;;
48         "neutron.plugins.mlnx.mlnx_plugin.MellanoxEswitchPlugin")
49                 NEUTRON_PLUGIN_NAME=Mellanox
50         ;;
51         *)
52                 NEUTRON_PLUGIN_NAME="other"
53         ;;
54         esac
55 }
56
57 ### Guess the path of the plugin .ini file depending on the plugin name ###
58 neutron_plugin_ini_path () {
59         PLUG_INI_BASE=/etc/neutron/plugins/
60         case ${1} in
61         "OpenVSwitch")
62                 NEUTRON_PLUGIN_CONFIG=${PLUG_INI_BASE}ml2/openvswitch_agent.ini
63         ;;
64         "LinuxBridge")
65                 NEUTRON_PLUGIN_CONFIG=${PLUG_INI_BASE}linuxbridge/linuxbridge_conf.ini
66         ;;
67         "ml2")
68                 NEUTRON_PLUGIN_CONFIG=${PLUG_INI_BASE}ml2/ml2_conf.ini
69         ;;
70         "RYU")
71                 NEUTRON_PLUGIN_CONFIG=${PLUG_INI_BASE}ryu/ryu.ini
72         ;;
73         "PLUMgrid")
74                 NEUTRON_PLUGIN_CONFIG=${PLUG_INI_BASE}plumgrid/plumgrid.ini
75         ;;
76         "Brocade")
77                 NEUTRON_PLUGIN_CONFIG=${PLUG_INI_BASE}brocade/brocade.ini
78         ;;
79         "Hyper-V")
80                 NEUTRON_PLUGIN_CONFIG=${PLUG_INI_BASE}hyperv/hyperv_neutron_plugin.ini
81         ;;
82         "BigSwitch")
83                 NEUTRON_PLUGIN_CONFIG=${PLUG_INI_BASE}bigswitch/restproxy.ini
84         ;;
85         "Cisco")
86                 NEUTRON_PLUGIN_CONFIG=${PLUG_INI_BASE}cisco/cisco_plugins.ini
87         ;;
88         "Nicira")
89                 NEUTRON_PLUGIN_CONFIG=${PLUG_INI_BASE}nicira/nvp.ini
90         ;;
91         "Midonet")
92                 NEUTRON_PLUGIN_CONFIG=${PLUG_INI_BASE}midonet/midonet.ini
93         ;;
94         "Nec")
95                 NEUTRON_PLUGIN_CONFIG=${PLUG_INI_BASE}nec/nec.ini
96         ;;
97         "MetaPlugin")
98                 NEUTRON_PLUGIN_CONFIG=${PLUG_INI_BASE}metaplugin/metaplugin.ini
99         ;;
100         "Mellanox")
101                 NEUTRON_PLUGIN_CONFIG=${PLUG_INI_BASE}mlnx/mlnx_conf.ini
102         ;;
103         *)
104                 NEUTRON_PLUGIN_CONFIG=""
105         ;;
106         esac
107 }
108
109 ### Translates the core_plugin directive value from neutron.conf into the plugin name ###
110 neutron_core_plugin_to_plugin_name () {
111         case ${1} in
112         "neutron.plugins.openvswitch.ovs_neutron_plugin.OVSNeutronPluginV2")
113                 NEUTRON_PLUGIN_NAME=OpenVSwitch
114         ;;
115         "neutron.plugins.linuxbridge.lb_neutron_plugin.LinuxBridgePluginV2")
116                 NEUTRON_PLUGIN_NAME=LinuxBridge
117         ;;
118         "neutron.plugins.ml2.plugin.Ml2Plugin")
119                 NEUTRON_PLUGIN_NAME=ml2
120         ;;
121         "neutron.plugins.ryu.ryu_neutron_plugin.RyuNeutronPluginV2")
122                 NEUTRON_PLUGIN_NAME=RYU
123         ;;
124         "neutron.plugins.plumgrid.plumgrid_nos_plugin.plumgrid_plugin.NeutronPluginPLUMgridV2")
125                 NEUTRON_PLUGIN_NAME=PLUMgrid
126         ;;
127         "neutron.plugins.brocade.NeutronPlugin.BrocadePluginV2")
128                 NEUTRON_PLUGIN_NAME=Brocade
129         ;;
130         "neutron.plugins.hyperv.hyperv_neutron_plugin.HyperVNeutronPlugin")
131                 NEUTRON_PLUGIN_NAME=Hyper-V
132         ;;
133         "neutron.plugins.bigswitch.plugin.NeutronRestProxyV2")
134                 NEUTRON_PLUGIN_NAME=BigSwitch
135         ;;
136         "neutron.plugins.cisco.network_plugin.PluginV2")
137                 NEUTRON_PLUGIN_NAME=Cisco
138         ;;
139         "neutron.plugins.nicira.NeutronPlugin.NvpPluginV2")
140                 NEUTRON_PLUGIN_NAME=neutron.plugins.nicira.NeutronPlugin.NvpPluginV2
141         ;;
142         "neutron.plugins.midonet.plugin.MidonetPluginV2")
143                 NEUTRON_PLUGIN_NAME=Midonet
144         ;;
145         "neutron.plugins.nec.nec_plugin.NECPluginV2")
146                 NEUTRON_PLUGIN_NAME=Nec
147         ;;
148         "neutron.plugins.metaplugin.meta_neutron_plugin.MetaPluginV2")
149                 NEUTRON_PLUGIN_NAME=MetaPlugin
150         ;;
151         "neutron.plugins.mlnx.mlnx_plugin.MellanoxEswitchPlugin")
152                 NEUTRON_PLUGIN_NAME=Mellanox
153         ;;
154         *)
155                 NEUTRON_PLUGIN_NAME="other"
156         ;;
157         esac
158 }