CORD-1908 Break service dependencies in CordSubscriberRoot
Change-Id: Id7afa4952998ef2f5f2a3b8ea8dce9f77e060c1c
diff --git a/xos/attic/cordsubscriberroot_model.py b/xos/attic/cordsubscriberroot_model.py
index 7c7e7b5..ef174c4 100644
--- a/xos/attic/cordsubscriberroot_model.py
+++ b/xos/attic/cordsubscriberroot_model.py
@@ -114,32 +114,22 @@
# Dirty all vSGs related to this subscriber, so the vSG synchronizer
# will run.
- # TODO: This should be reimplemented to use a watcher instead.
-
- # TODO: Hardcoded service dependency
-
- from services.volt.models import VOLTTenant
- from services.vsg.models import VSGTenant
+ # TODO: This should be reimplemented when multiple-objects-per-synchronizer is implemented.
for link in self.subscribed_links.all():
- # cast from base class to derived class
- volts = VOLTTenant.objects.filter(serviceinstance_ptr = link.provider_service_instance)
- for volt in volts:
- for inner_link in volt.subscribed_links.all():
- # cast from base class to derived class
- vsgs = VSGTenant.objects.filter(serviceinstance_ptr = inner_link.provider_service_instance)
- for vsg in vsgs:
- vsg.save()
+ outer_service_instance = link.provider_service_instance
+ for link in outer_service_instance.subscribed_links.all():
+ inner_service_instance = link.provider_service_instance
+ inner_service_instance.save(update_fields = ["updated"])
def __xos_save_base(self, *args, **kwargs):
self.validate_unique_service_specific_id(none_okay=True)
if (not hasattr(self, 'caller') or not self.caller.is_admin):
if (self.has_field_changed("service_specific_id")):
raise XOSPermissionDenied("You do not have permission to change service_specific_id")
-
+
super(CordSubscriberRoot, self).save(*args, **kwargs)
self.invalidate_related_objects()
return True # Indicate that we called super.save()
-