fix bug
diff --git a/planetstack/observer/steps/sync_roles.py b/planetstack/observer/steps/sync_roles.py
index 18a784a..5dc30d9 100644
--- a/planetstack/observer/steps/sync_roles.py
+++ b/planetstack/observer/steps/sync_roles.py
@@ -29,12 +29,9 @@
def sync_record(self, role):
- save_role = False
- if not role.krole_id:
- krole = self.driver.create_role(role.role)
- role.krole_id = krole.id
- save_role = True
-
- if (save_role):
- role.save()
-
+ if not role.enacted:
+ deployments = Deployment.objects.all()
+ for deployment in deployments:
+ driver = self.driver.admin_driver(deployment=deployment.name)
+ driver.create_role(role.role)
+ role.save()