CORD-770 Change TenantWithContainer from proxy to real model, rebuild openstack synchronizer when models are added, fix reaper to ignore parent classes
Change-Id: Ic54a9cdd36583dc65b28404c5d50a97f078e8526
diff --git a/xos/synchronizers/onboarding/steps/sync_servicecontrollerresource.py b/xos/synchronizers/onboarding/steps/sync_servicecontrollerresource.py
index a089bec..238b149 100644
--- a/xos/synchronizers/onboarding/steps/sync_servicecontrollerresource.py
+++ b/xos/synchronizers/onboarding/steps/sync_servicecontrollerresource.py
@@ -28,11 +28,22 @@
logger.info("Sync'ing ServiceControllerResource %s" % scr)
self.download_resource(scr)
+ # TODO: The following should be redone with watchers
+
if scr.loadable_module and scr.loadable_module.xos:
# Make sure the xos UI is resynced
xos = scr.loadable_module.xos
xos.save(update_fields=["updated"], always_update_timestamp=True)
+ if (scr.kind=="models") and scr.loadable_module and (scr.loadable_module.name != "openstack"):
+ # Make sure the openstack controller is restarted. This is necessary
+ # as the OpenStack controller is the only one that handles model
+ # policies.
+ os_scr = ServiceController.objects.filter(name="openstack")
+ if os_scr:
+ os_scr = os_scr[0]
+ os_scr.save(update_fields=["updated"], always_update_timestamp=True)
+
def delete_record(self, m):
pass