include DeploymentRole in role sync
diff --git a/planetstack/core/models/deployment.py b/planetstack/core/models/deployment.py
index 8bf9c06..9a4cbe1 100644
--- a/planetstack/core/models/deployment.py
+++ b/planetstack/core/models/deployment.py
@@ -15,6 +15,7 @@
ROLE_CHOICES = (('admin','Admin'),)
role = models.CharField(choices=ROLE_CHOICES, unique=True, max_length=30)
+ krole_id = models.CharField(max_length=80, verbose_name="Keystone role id", null=True, blank=True)
def __unicode__(self): return u'%s' % (self.role)
diff --git a/planetstack/observer/steps/sync_roles.py b/planetstack/observer/steps/sync_roles.py
index 091ab74..6f7373a 100644
--- a/planetstack/observer/steps/sync_roles.py
+++ b/planetstack/observer/steps/sync_roles.py
@@ -6,6 +6,7 @@
from core.models.role import Role
from core.models.site import SiteRole
from core.models.slice import SliceRole
+from core.models.deployment import DeploymentRole
class SyncRoles(OpenStackSyncStep):
provides=[Role]
@@ -14,12 +15,15 @@
def fetch_pending(self):
site_roles = SiteRole.objects.filter(Q(enacted__lt=F('updated')) | Q(enacted=None)
slice_roles = SliceRole.objects.filter(Q(enacted__lt=F('updated')) | Q(enacted=None))
+ deployment_roles = DeploymentRole.objects.filter(Q(enacted__lt=F('updated')) | Q(enacted=None))
roles = []
for site_role in site_roles:
roles.append(site_role)
for slice_role in slice_roles:
roles.append(slice_role)
+ for deployment_role in deployment_roles:
+ roles.append(deployment_role)
return roles