171
172
'services': ['calico-felix',
173
174
'neutron-dhcp-agent',
174
'nova-api-metadata'],
175
177
'packages': [[headers_package()] + determine_dkms_package(),
176
178
['calico-compute',
178
180
'neutron-dhcp-agent',
179
'nova-api-metadata']],
180
'server_packages': ['neutron-server', 'calico-control'],
183
'server_packages': ['neutron-server', 'calico-control', 'etcd'],
184
'server_services': ['neutron-server', 'etcd']
187
'config': '/etc/neutron/plugins/nuage/nuage_plugin.ini',
188
'driver': 'neutron.plugins.nuage.plugin.NuagePlugin',
190
context.SharedDBContext(user=config('neutron-database-user'),
191
database=config('neutron-database'),
192
relation_prefix='neutron',
193
ssl_dir=NEUTRON_CONF_DIR)],
196
'server_packages': ['neutron-server', 'neutron-plugin-nuage'],
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'],
181
211
'server_services': ['neutron-server']
238
268
# ensure accurate naming for all releases post-H
272
def parse_mappings(mappings, key_rvalue=False):
273
"""By default mappings are lvalue keyed.
275
If key_rvalue is True, the mapping will be reversed to allow multiple
276
configs for the same lvalue.
280
mappings = mappings.split()
287
# if there is no rvalue skip to next
294
key = p[key_index].strip()
295
parsed[key] = p[val_index].strip()
300
def parse_bridge_mappings(mappings):
301
"""Parse bridge mappings.
303
Mappings must be a space-delimited list of provider:bridge mappings.
305
Returns dict of the form {provider:bridge}.
307
return parse_mappings(mappings)
310
def parse_data_port_mappings(mappings, default_bridge='br-data'):
311
"""Parse data port mappings.
313
Mappings must be a space-delimited list of port:bridge mappings.
315
Returns dict of the form {port:bridge} where port may be an mac address or
319
# NOTE(dosaboy): we use rvalue for key to allow multiple values to be
320
# proposed for <port> since it may be a mac address which will differ
321
# across units this allowing first-known-good to be chosen.
322
_mappings = parse_mappings(mappings, key_rvalue=True)
323
if not _mappings or list(_mappings.values()) == ['']:
327
# For backwards-compatibility we need to support port-only provided in
329
_mappings = {mappings.split()[0]: default_bridge}
331
ports = _mappings.keys()
332
if len(set(ports)) != len(ports):
333
raise Exception("It is not allowed to have the same port configured "
334
"on more than one bridge")
339
def parse_vlan_range_mappings(mappings):
340
"""Parse vlan range mappings.
342
Mappings must be a space-delimited list of provider:start:end mappings.
344
The start:end range is optional and may be omitted.
346
Returns dict of the form {provider: (start, end)}.
348
_mappings = parse_mappings(mappings)
353
for p, r in six.iteritems(_mappings):
354
mappings[p] = tuple(r.split(':'))