skip slices that have not been synced at the deployment
diff --git a/planetstack/observer/steps/sync_slice_memberships.py b/planetstack/observer/steps/sync_slice_memberships.py
index 08b7b6a..6a4f75f 100644
--- a/planetstack/observer/steps/sync_slice_memberships.py
+++ b/planetstack/observer/steps/sync_slice_memberships.py
@@ -14,14 +14,11 @@
return SlicePrivilege.objects.filter(Q(enacted__lt=F('updated')) | Q(enacted=None))
def sync_record(self, slice_memb):
- if slice_memb.user.kuser_id and slice_memb.slice.tenant_id:
- self.driver.add_user_role(slice_memb.user.kuser_id,
- slice_memb.slice.tenant_id,
- slice_memb.role.role)
-
# sync slice memberships at all slice deployments
slice_deployments = SliceDeployments.objects.filter(slice=slice_memb.slice)
for slice_deployment in slice_deployments:
+ if not slice_deployment.tenant_id:
+ continue
user_deployments = UserDeployments.objects.filter(deployment=slice_deployment.deployment)
if user_deployments:
kuser_id = user_deployments[0].kuser_id