Skip to content
Snippets Groups Projects
Commit 571a05e0 authored by Henrik Thostrup Jensen's avatar Henrik Thostrup Jensen
Browse files

allow mpls and no label in nml topology generation

parent c299c7e6
No related branches found
No related tags found
No related merge requests found
......@@ -23,20 +23,23 @@ BIDIRECTIONAL = 'Bidirectional'
EVTS_AGOLE = 'http://services.ogf.org/nsi/2013/07/descriptions/EVTS.A-GOLE'
ETHERNET_NS = 'http://schemas.ogf.org/nml/2012/10/ethernet'
NML_ETHERNET_VLAN = '%s#vlan' % ETHERNET_NS
# Port types
# port types
ETHERNET = 'ethernet' # bidirectional implied
ETHERNET_VLAN = 'vlan'
MPLS = 'mpls'
RESTRICTTRANSIT = 'restricttransit'
# nml
ETHERNET_NS = 'http://schemas.ogf.org/nml/2012/10/ethernet'
NML_ETHERNET_VLAN = '%s#vlan' % ETHERNET_NS
NML_MPLS = 'http://nsi.nordu.net/nml#mpls' # pretty much just made up
FEATURE_AGGREGATOR = 'vnd.ogf.nsi.cs.v2.role.aggregator'
FEATURE_UPA = 'vnd.ogf.nsi.cs.v2.role.uPA'
# Policies
# policies
REQUIRE_USER = 'requireuser'
REQUIRE_TRACE = 'requiretrace'
......@@ -82,7 +82,10 @@ class BidirectionalPort(object):
assert type(name) is str, 'Port name must be a string'
assert isinstance(inbound_port, Port), 'Inbound port must be a <Port>'
assert isinstance(outbound_port, Port), 'Outbound port must be a <Port>'
assert inbound_port.label().type_ == outbound_port.label().type_, 'Port labels must match each other'
if inbound_port.label() is None and outbound_port.label() is None:
pass # ok
else:
assert inbound_port.label().type_ == outbound_port.label().type_, 'Port labels must match each other'
assert not id_.startswith('urn:'), 'URNs are not used in core OpenNSA NML (id: %s)' % id_
self.id_ = id_
......
......@@ -53,7 +53,8 @@ NML_HASSERVICE = NML_NS + 'hasService'
NML_LABEL_MAPPING = {
cnt.ETHERNET_VLAN : cnt.NML_ETHERNET_VLAN
cnt.ETHERNET_VLAN : cnt.NML_ETHERNET_VLAN,
cnt.MPLS : cnt.NML_MPLS
}
NSI_SERVICE_DEFINITION = ET.QName('{%s}serviceDefinition' % NSI_DEF_NS)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment