[CORD-3156] Adding support for mac_address in olt-service
Change-Id: I945257416f527b2d019231c9abc4cdf44a5a6a58
diff --git a/xos/synchronizer/models/models.py b/xos/synchronizer/models/models.py
index ed1e062..3dcefae 100644
--- a/xos/synchronizer/models/models.py
+++ b/xos/synchronizer/models/models.py
@@ -46,6 +46,13 @@
def get_volt_si(self):
return VOLTServiceInstance.objects.all()
+ def save(self, *args, **kwargs):
+
+ if (self.host or self.port) and self.mac_address:
+ raise XOSValidationError("You can't specify both host/port and mac_address for OLTDevice [host=%s, port=%s, mac_address=%s]" % (self.host, self.port, self.mac_address))
+
+ super(OLTDevice, self).save(*args, **kwargs)
+
def delete(self, *args, **kwargs):
onus = []