Do not disable ONU as result of an onu.disabled event,
save the subscriber from dhcp only if something has changed.
Change-Id: I4a97bb7fe2e08e408341aa36617709b554e9e5bb
diff --git a/xos/synchronizer/event_steps/dhcp_event.py b/xos/synchronizer/event_steps/dhcp_event.py
index d6a789f..eec273d 100644
--- a/xos/synchronizer/event_steps/dhcp_event.py
+++ b/xos/synchronizer/event_steps/dhcp_event.py
@@ -47,6 +47,9 @@
# NOTE it will be better to update the SI and use the model policy to update the subscriber,
# if this fails for any reason the event is lost
- subscriber.ip_address = value["ipAddress"]
- subscriber.mac_address = value["macAddress"]
- subscriber.save()
+ if subscriber.ip_address != value["ipAddress"] or \
+ subscriber.mac_address != value["macAddress"]:
+
+ subscriber.ip_address = value["ipAddress"]
+ subscriber.mac_address = value["macAddress"]
+ subscriber.save()