[hopem,r=]
Fixes network-vlan-ranges parsing Partially-Closes-Bug: 1451095
This commit is contained in:
parent
a29db44a40
commit
7213b596e5
|
@ -153,8 +153,10 @@ options:
|
||||||
type: string
|
type: string
|
||||||
default: "physnet1:1000:2000"
|
default: "physnet1:1000:2000"
|
||||||
description: |
|
description: |
|
||||||
Space-delimited list of Neutron network-provider & vlan-id-ranges using
|
Space-delimited list of <physical_network>:<vlan_min>:<vlan_max> or
|
||||||
format "<provider>:<start>:<end> ...".
|
<physical_network> specifying physical_network names usable for VLAN
|
||||||
|
provider and tenant networks, as well as ranges of VLAN tags on each
|
||||||
|
available for allocation to tenant networks.
|
||||||
# Network configuration options
|
# Network configuration options
|
||||||
# by default all access is over 'private-address'
|
# by default all access is over 'private-address'
|
||||||
os-data-network:
|
os-data-network:
|
||||||
|
|
|
@ -256,11 +256,14 @@ def network_manager():
|
||||||
def parse_mappings(mappings):
|
def parse_mappings(mappings):
|
||||||
parsed = {}
|
parsed = {}
|
||||||
if mappings:
|
if mappings:
|
||||||
mappings = mappings.split(' ')
|
mappings = mappings.split()
|
||||||
for m in mappings:
|
for m in mappings:
|
||||||
p = m.partition(':')
|
p = m.partition(':')
|
||||||
if p[1] == ':':
|
key = p[0].strip()
|
||||||
parsed[p[0].strip()] = p[2].strip()
|
if p[1]:
|
||||||
|
parsed[key] = p[2].strip()
|
||||||
|
else:
|
||||||
|
parsed[key] = ''
|
||||||
|
|
||||||
return parsed
|
return parsed
|
||||||
|
|
||||||
|
@ -283,13 +286,13 @@ def parse_data_port_mappings(mappings, default_bridge='br-data'):
|
||||||
Returns dict of the form {bridge:port}.
|
Returns dict of the form {bridge:port}.
|
||||||
"""
|
"""
|
||||||
_mappings = parse_mappings(mappings)
|
_mappings = parse_mappings(mappings)
|
||||||
if not _mappings:
|
if not _mappings or _mappings.values() == ['']:
|
||||||
if not mappings:
|
if not mappings:
|
||||||
return {}
|
return {}
|
||||||
|
|
||||||
# For backwards-compatibility we need to support port-only provided in
|
# For backwards-compatibility we need to support port-only provided in
|
||||||
# config.
|
# config.
|
||||||
_mappings = {default_bridge: mappings.split(' ')[0]}
|
_mappings = {default_bridge: mappings.split()[0]}
|
||||||
|
|
||||||
bridges = _mappings.keys()
|
bridges = _mappings.keys()
|
||||||
ports = _mappings.values()
|
ports = _mappings.values()
|
||||||
|
@ -309,6 +312,8 @@ def parse_vlan_range_mappings(mappings):
|
||||||
|
|
||||||
Mappings must be a space-delimited list of provider:start:end mappings.
|
Mappings must be a space-delimited list of provider:start:end mappings.
|
||||||
|
|
||||||
|
The start:end range is optional and may be omitted.
|
||||||
|
|
||||||
Returns dict of the form {provider: (start, end)}.
|
Returns dict of the form {provider: (start, end)}.
|
||||||
"""
|
"""
|
||||||
_mappings = parse_mappings(mappings)
|
_mappings = parse_mappings(mappings)
|
||||||
|
|
|
@ -930,7 +930,8 @@ class TestQuantumAgentReallocation(CharmTestCase):
|
||||||
'process_name': 'neutron-nvsd-agent',
|
'process_name': 'neutron-nvsd-agent',
|
||||||
'executable_name': '/usr/local/bin/neutron-nvsd-agent',
|
'executable_name': '/usr/local/bin/neutron-nvsd-agent',
|
||||||
'config_files': ['/etc/neutron/neutron.conf',
|
'config_files': ['/etc/neutron/neutron.conf',
|
||||||
'/etc/neutron/plugins/oneconvergence/nvsdplugin.ini'],
|
'/etc/neutron/plugins/oneconvergence/'
|
||||||
|
'nvsdplugin.ini'],
|
||||||
'log_file': '/var/log/neutron/nvsd-agent.log',
|
'log_file': '/var/log/neutron/nvsd-agent.log',
|
||||||
}
|
}
|
||||||
neutron_plugin_openflow_context = {
|
neutron_plugin_openflow_context = {
|
||||||
|
|
Loading…
Reference in New Issue