Make admin role name a config variable as it varies between openstack deployments
diff --git a/xos/configurations/cord-pod/xos_cord_config b/xos/configurations/cord-pod/xos_cord_config
index a5448f7..4d2d13b 100644
--- a/xos/configurations/cord-pod/xos_cord_config
+++ b/xos/configurations/cord-pod/xos_cord_config
@@ -4,3 +4,7 @@
branding_icon=/static/cord-logo.png
branding_favicon=/static/cord-favicon.png
branding_bg=/static/cord-bg.jpg
+
+[nova]
+admin_role=Admin
+
diff --git a/xos/synchronizers/openstack/steps/sync_controller_slices.py b/xos/synchronizers/openstack/steps/sync_controller_slices.py
index 2f36441..081a384 100644
--- a/xos/synchronizers/openstack/steps/sync_controller_slices.py
+++ b/xos/synchronizers/openstack/steps/sync_controller_slices.py
@@ -31,7 +31,8 @@
raise Exception("slice createor %s has not accout at controller %s" % (controller_slice.slice.creator, controller_slice.controller.name))
else:
controller_user = controller_users[0]
- roles = ['admin']
+ admin_role = getattr(Config(), "nova_admin_role", "admin")
+ roles = [admin_role]
max_instances=int(controller_slice.slice.max_instances)
tenant_fields = {'endpoint':controller_slice.controller.auth_url,
diff --git a/xos/synchronizers/openstack/steps/sync_controller_users.py b/xos/synchronizers/openstack/steps/sync_controller_users.py
index 0f6636e..3b1e8a1 100644
--- a/xos/synchronizers/openstack/steps/sync_controller_users.py
+++ b/xos/synchronizers/openstack/steps/sync_controller_users.py
@@ -25,9 +25,10 @@
# All users will have at least the 'user' role at their home site/tenant.
# We must also check if the user should have the admin role
+ admin_role = getattr(Config(), "nova_admin_role", "admin")
roles = ['user']
if controller_user.user.is_admin:
- roles.append('admin')
+ roles.append(admin_role)
# setup user home site roles at controller
if not controller_user.user.site: