196
196
'server_packages': ['neutron-server', 'neutron-plugin-nuage'],
197
197
'server_services': ['neutron-server']
200
'config': '/etc/neutron/plugins/plumgrid/plumgrid.ini',
201
'driver': 'neutron.plugins.plumgrid.plumgrid_plugin.plumgrid_plugin.NeutronPluginPLUMgridV2',
203
context.SharedDBContext(user=config('database-user'),
204
database=config('database'),
205
ssl_dir=NEUTRON_CONF_DIR)],
207
'packages': [['plumgrid-lxc'],
209
'server_packages': ['neutron-server',
210
'neutron-plugin-plumgrid'],
211
'server_services': ['neutron-server']
214
'config': '/etc/neutron/plugins/midonet/midonet.ini',
215
'driver': 'midonet.neutron.plugin.MidonetPluginV2',
217
context.SharedDBContext(user=config('neutron-database-user'),
218
database=config('neutron-database'),
219
relation_prefix='neutron',
220
ssl_dir=NEUTRON_CONF_DIR)],
222
'packages': [[headers_package()] + determine_dkms_package()],
223
'server_packages': ['neutron-server',
224
'python-neutron-plugin-midonet'],
225
'server_services': ['neutron-server']
200
228
if release >= 'icehouse':
258
def parse_mappings(mappings):
286
def parse_mappings(mappings, key_rvalue=False):
287
"""By default mappings are lvalue keyed.
289
If key_rvalue is True, the mapping will be reversed to allow multiple
290
configs for the same lvalue.
261
294
mappings = mappings.split()
262
295
for m in mappings:
263
296
p = m.partition(':')
266
parsed[key] = p[2].strip()
301
# if there is no rvalue skip to next
308
key = p[key_index].strip()
309
parsed[key] = p[val_index].strip()
283
324
def parse_data_port_mappings(mappings, default_bridge='br-data'):
284
325
"""Parse data port mappings.
286
Mappings must be a space-delimited list of bridge:port mappings.
327
Mappings must be a space-delimited list of bridge:port.
288
Returns dict of the form {bridge:port}.
329
Returns dict of the form {port:bridge} where ports may be mac addresses or
290
_mappings = parse_mappings(mappings)
333
# NOTE(dosaboy): we use rvalue for key to allow multiple values to be
334
# proposed for <port> since it may be a mac address which will differ
335
# across units this allowing first-known-good to be chosen.
336
_mappings = parse_mappings(mappings, key_rvalue=True)
291
337
if not _mappings or list(_mappings.values()) == ['']:
295
341
# For backwards-compatibility we need to support port-only provided in
297
_mappings = {default_bridge: mappings.split()[0]}
299
bridges = _mappings.keys()
300
ports = _mappings.values()
301
if len(set(bridges)) != len(bridges):
302
raise Exception("It is not allowed to have more than one port "
303
"configured on the same bridge")
343
_mappings = {mappings.split()[0]: default_bridge}
345
ports = _mappings.keys()
305
346
if len(set(ports)) != len(ports):
306
347
raise Exception("It is not allowed to have the same port configured "
307
348
"on more than one bridge")