SEBA-497 delayering, Makefile, and tox for fabric-crossconnect-synchronizer
Change-Id: Ibcf8fd06b9ad94d3f198887c18be7adfa4d5a954
diff --git a/xos/synchronizer/models/convenience/fabric_crossconnect_service.py b/xos/synchronizer/models/convenience/fabric_crossconnect_service.py
index c2bb8bf..863f40c 100644
--- a/xos/synchronizer/models/convenience/fabric_crossconnect_service.py
+++ b/xos/synchronizer/models/convenience/fabric_crossconnect_service.py
@@ -14,9 +14,10 @@
# limitations under the License.
-from xosapi.orm import ORMWrapper, register_convenience_wrapper
+from xosapi.orm import register_convenience_wrapper
from xosapi.convenience.service import ORMWrapperService
+
class ORMWrapperFabricCrossconnectService(ORMWrapperService):
""" Calling convention. Assume the subscribing service does approximately (needs some checks to see
@@ -45,9 +46,9 @@
provider_service_instance = candidates[0]
else:
provider_service_instance = FabricCrossconnectServiceInstance(owner=self,
- s_tag=s_tag,
- switch_datapath_id=switch_datapath_id,
- source_port=source_port)
+ s_tag=s_tag,
+ switch_datapath_id=switch_datapath_id,
+ source_port=source_port)
provider_service_instance.save()
# NOTE: Lack-of-atomicity vulnerability -- provider_service_instance could be deleted before we created the
@@ -77,7 +78,7 @@
if link.provider_service_instance.owner.id == self.id:
fcsi = link.provider_service_instance.leaf_model
if (fcsi.s_tag == s_tag) and (fcsi.switch_datapath_id == switch_datapath_id) and \
- (fcsi.source_port == source_port):
+ (fcsi.source_port == source_port):
matched.append(fcsi)
else:
link.delete()
@@ -91,7 +92,8 @@
"""
s_tag = subscriber_si.get_westbound_service_instance_properties("s_tag", include_self=True)
- switch_datapath_id = subscriber_si.get_westbound_service_instance_properties("switch_datapath_id", include_self=True)
+ switch_datapath_id = subscriber_si.get_westbound_service_instance_properties(
+ "switch_datapath_id", include_self=True)
source_port = subscriber_si.get_westbound_service_instance_properties("switch_port", include_self=True)
if (s_tag is None):
@@ -108,4 +110,5 @@
return (s_tag, switch_datapath_id, source_port)
+
register_convenience_wrapper("FabricCrossconnectService", ORMWrapperFabricCrossconnectService)