SEBA-497 delayering, Makefile, and tox for rcord-synchronizer
Change-Id: I1005db39de51e43bdfd9b17fe6290a37131e4605
diff --git a/xos/synchronizer/models/models.py b/xos/synchronizer/models/models.py
index 7227ab9..f5ac079 100644
--- a/xos/synchronizer/models/models.py
+++ b/xos/synchronizer/models/models.py
@@ -16,17 +16,20 @@
import socket
import random
-from xos.exceptions import XOSValidationError, XOSProgrammingError, XOSPermissionDenied
+from xos.exceptions import XOSValidationError, XOSProgrammingError
from models_decl import RCORDService_decl, RCORDSubscriber_decl, RCORDIpAddress_decl, BandwidthProfile_decl
+
class BandwidthProfile(BandwidthProfile_decl):
class Meta:
proxy = True
+
class RCORDService(RCORDService_decl):
class Meta:
proxy = True
+
class RCORDIpAddress(RCORDIpAddress_decl):
class Meta:
proxy = True
@@ -44,6 +47,7 @@
super(RCORDIpAddress, self).save(*args, **kwargs)
return
+
class RCORDSubscriber(RCORDSubscriber_decl):
class Meta:
@@ -149,7 +153,9 @@
is_update_with_same_tag = True
if self.c_tag in self.get_used_c_tags() and not is_update_with_same_tag:
- raise XOSValidationError("The c_tag you specified (%s) has already been used on device %s" % (self.c_tag, self.onu_device))
+ raise XOSValidationError(
+ "The c_tag you specified (%s) has already been used on device %s" %
+ (self.c_tag, self.onu_device))
# validate s_tag and c_tag combination
if self.c_tag and self.s_tag:
@@ -173,10 +179,14 @@
self.set_owner()
- if self.status != "pre-provisioned" and hasattr(self.owner.leaf_model, "access") and self.owner.leaf_model.access == "voltha" and not self.deleted:
+ if self.status != "pre-provisioned" and \
+ hasattr(self.owner.leaf_model, "access") and \
+ self.owner.leaf_model.access == "voltha" and \
+ not self.deleted:
# if the access network is managed by voltha, validate that onu_device actually exist
- volt_service = self.owner.provider_services[0].leaf_model # we assume RCORDService is connected only to the vOLTService
+ # we assume RCORDService is connected only to the vOLTService
+ volt_service = self.owner.provider_services[0].leaf_model
if not volt_service.has_access_device(self.onu_device):
raise XOSValidationError("The onu_device you specified (%s) does not exists" % self.onu_device)