more
This commit is contained in:
parent
44d2c1e462
commit
9c7a35104d
@ -239,10 +239,10 @@ def network_manager():
|
|||||||
return 'neutron'
|
return 'neutron'
|
||||||
|
|
||||||
|
|
||||||
def parse_mappings(mappings):
|
def parse_mappings(mappings, delimiter=' '):
|
||||||
parsed = {}
|
parsed = {}
|
||||||
if mappings:
|
if mappings:
|
||||||
mappings = mappings.split(' ')
|
mappings = mappings.split(delimiter)
|
||||||
for m in mappings:
|
for m in mappings:
|
||||||
p = m.partition(':')
|
p = m.partition(':')
|
||||||
if p[1] == ':':
|
if p[1] == ':':
|
||||||
@ -280,3 +280,18 @@ def parse_data_port_mappings(mappings):
|
|||||||
"on more than one bridge")
|
"on more than one bridge")
|
||||||
|
|
||||||
return mappings
|
return mappings
|
||||||
|
|
||||||
|
|
||||||
|
def parse_vlan_range_mappings(mappings):
|
||||||
|
"""Parse vlan range mappings.
|
||||||
|
|
||||||
|
Mappings must be a space-delimited list of provider:start:end mappings.
|
||||||
|
|
||||||
|
Returns dict of the form {provider: (start, end)}.
|
||||||
|
"""
|
||||||
|
_mappings = parse_mappings(mappings)
|
||||||
|
mappings = {}
|
||||||
|
for p, r in _mappings.iteritems():
|
||||||
|
mappings[p] = tuple(r.split(':'))
|
||||||
|
|
||||||
|
return mappings
|
||||||
|
Loading…
x
Reference in New Issue
Block a user