diff --git a/opennsa/constants.py b/opennsa/constants.py index 09f437624c9a10111581c69ebb9885d58fb4619b..1139b98698478beab83cdfee486b67d7d81ac722 100644 --- a/opennsa/constants.py +++ b/opennsa/constants.py @@ -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' diff --git a/opennsa/topology/nml.py b/opennsa/topology/nml.py index 9008d478a6335d6ca960cc7fb09e7610e24e2d80..3e477e827e15fe00c299d29f0953d620628ebbd4 100644 --- a/opennsa/topology/nml.py +++ b/opennsa/topology/nml.py @@ -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_ diff --git a/opennsa/topology/nmlxml.py b/opennsa/topology/nmlxml.py index f603dc823fee3953e416376866ac64d5f3c7914d..72a3bc20e72f675d698a3968acf99285bf74cff9 100644 --- a/opennsa/topology/nmlxml.py +++ b/opennsa/topology/nmlxml.py @@ -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)