Make the admin role configurable within tempest
Adds a configuration variable for the admin role.
Change-Id: Ib7f1eaaefedebd6f0d608b0645950d0b64d87f7a
Closes-Bug: #1224742
diff --git a/tempest/common/isolated_creds.py b/tempest/common/isolated_creds.py
index 22e1bd2..d6b4466 100644
--- a/tempest/common/isolated_creds.py
+++ b/tempest/common/isolated_creds.py
@@ -141,10 +141,11 @@
role = None
try:
roles = self._list_roles()
+ admin_role = self.config.identity.admin_role
if self.tempest_client:
- role = next(r for r in roles if r['name'] == 'admin')
+ role = next(r for r in roles if r['name'] == admin_role)
else:
- role = next(r for r in roles if r.name == 'admin')
+ role = next(r for r in roles if r.name == admin_role)
except StopIteration:
msg = "No admin role found"
raise exceptions.NotFound(msg)