This commit is contained in:
Edward Hope-Morley 2015-03-03 13:48:05 +08:00
parent 4ae7872361
commit c1cb8839c4

View File

@ -264,8 +264,19 @@ def parse_bridge_mappings(mappings):
def parse_data_port_mappings(mappings):
"""Parse data port mappings.
Mappings must be a space-delimited list of provider:port mappings.
Mappings must be a space-delimited list of bridge:port mappings.
Returns dict of the form {provider:port}.
Returns dict of the form {bridge:port}.
"""
return parse_mappings(mappings)
mappings = parse_mappings(mappings)
bridges = mappings.keys()
ports = mappings.values()
if len(set(bridges)) != len(bridges):
raise Exception("It is not allowed to have more than one port "
"configured on the same bridge")
if len(set(ports)) != len(ports):
raise Exception("It is not allowed to have the same port configured "
"on more than one bridge")
return mappings