diff options
author | Cédric Ollivier <cedric.ollivier@orange.com> | 2018-07-23 22:59:11 +0200 |
---|---|---|
committer | Cédric Ollivier <cedric.ollivier@orange.com> | 2018-07-23 22:59:11 +0200 |
commit | 26c3f7a68d4d24fcb016b578d6f292ee25a71de5 (patch) | |
tree | 0b71c1428d5ca2b2669e6120ceacbedb37a625f2 | |
parent | 1d6834734bda91a99a01d54c4485e022e1fb87a2 (diff) |
Detect admin or Admin role
As Keystone roles are case insensitive, Admin is checked as well.
Change-Id: I28a611add7890c3188a289d1e24c043d88c34ea1
Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
-rw-r--r-- | functest/opnfv_tests/openstack/shaker/shaker.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/functest/opnfv_tests/openstack/shaker/shaker.py b/functest/opnfv_tests/openstack/shaker/shaker.py index 4f774483b..51244e2d5 100644 --- a/functest/opnfv_tests/openstack/shaker/shaker.py +++ b/functest/opnfv_tests/openstack/shaker/shaker.py @@ -58,8 +58,14 @@ class Shaker(singlevm.SingleVm2): assert self.ssh endpoint = self.get_public_auth_url(self.orig_cloud) self.__logger.debug("keystone endpoint: %s", endpoint) + if self.orig_cloud.get_role("admin"): + role_name = "admin" + elif self.orig_cloud.get_role("Admin"): + role_name = "Admin" + else: + raise Exception("Cannot detect neither admin nor Admin") self.orig_cloud.grant_role( - "admin", user=self.project.user.id, + role_name, user=self.project.user.id, project=self.project.project.id, domain=self.project.domain.id) if not self.orig_cloud.get_role("heat_stack_owner"): |